From bd4c33d1c216e1f15bed650b50aa9a67dc3574e5 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Tue, 4 Apr 2023 15:57:50 +0800 Subject: [PATCH] fix(tmq):fix the invalid read. --- source/libs/stream/src/stream.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/libs/stream/src/stream.c b/source/libs/stream/src/stream.c index df8847c26d..361cd2cacc 100644 --- a/source/libs/stream/src/stream.c +++ b/source/libs/stream/src/stream.c @@ -287,12 +287,12 @@ int32_t tAppendDataForStream(SStreamTask* pTask, SStreamQueueItem* pItem) { return -1; } - taosWriteQitem(pTask->inputQueue->queue, pSubmitBlock); - - int32_t total = taosQueueItemSize(pTask->inputQueue->queue); + int32_t total = taosQueueItemSize(pTask->inputQueue->queue) + 1; qDebug("stream task:%d %p submit enqueue %p %p %p msgLen:%d ver:%" PRId64 ", total in queue:%d", pTask->taskId, pTask, pItem, pSubmitBlock, pSubmitBlock->submit.msgStr, pSubmitBlock->submit.msgLen, pSubmitBlock->submit.ver, total); + + taosWriteQitem(pTask->inputQueue->queue, pSubmitBlock); } else if (type == STREAM_INPUT__DATA_BLOCK || type == STREAM_INPUT__DATA_RETRIEVE || type == STREAM_INPUT__REF_DATA_BLOCK) { taosWriteQitem(pTask->inputQueue->queue, pItem); -- GitLab