From 762cfef4981c2bda5902f03335ceb15e3b9c6c69 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Tue, 31 Oct 2023 11:51:47 +0800 Subject: [PATCH] fix(stream): adjust the stop condition for stream tasks. --- source/libs/stream/src/streamExec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/libs/stream/src/streamExec.c b/source/libs/stream/src/streamExec.c index e4365fe625..15b809d6bd 100644 --- a/source/libs/stream/src/streamExec.c +++ b/source/libs/stream/src/streamExec.c @@ -24,7 +24,7 @@ static int32_t streamDoTransferStateToStreamTask(SStreamTask* pTask); bool streamTaskShouldStop(const SStreamTask* pTask) { ETaskStatus s = streamTaskGetStatus(pTask, NULL); - return (s == TASK_STATUS__STOP) || (s == TASK_STATUS__DROPPING) || (s == TASK_STATUS__UNINIT); + return (s == TASK_STATUS__STOP) || (s == TASK_STATUS__DROPPING); } bool streamTaskShouldPause(const SStreamTask* pTask) { @@ -525,7 +525,7 @@ int32_t streamExecForAll(SStreamTask* pTask) { int32_t blockSize = 0; int32_t numOfBlocks = 0; SStreamQueueItem* pInput = NULL; - if (streamTaskShouldStop(pTask)) { + if (streamTaskShouldStop(pTask) || (streamTaskGetStatus(pTask, NULL) == TASK_STATUS__UNINIT)) { stDebug("s-task:%s stream task is stopped", id); break; }