From 4694859325bfa23b35c6a0d4ecdaadf836454b5c Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Tue, 31 Oct 2023 19:31:00 +0800 Subject: [PATCH] fix(stream): add jump out loop by checking task status. --- source/libs/stream/src/streamTaskSm.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/libs/stream/src/streamTaskSm.c b/source/libs/stream/src/streamTaskSm.c index 8055139971..b623172381 100644 --- a/source/libs/stream/src/streamTaskSm.c +++ b/source/libs/stream/src/streamTaskSm.c @@ -202,9 +202,12 @@ static int32_t doHandleEvent(SStreamTaskSM* pSM, EStreamTaskEvent event, STaskSt if ((s == pTrans->next.state) && (pSM->prev.evt == pTrans->event)) { stDebug("s-task:%s attached event:%s handled", id, StreamTaskEventList[pTrans->event].name); return TSDB_CODE_SUCCESS; - } else { // this event has been handled already + } else if (s != TASK_STATUS__DROPPING && s != TASK_STATUS__STOP) { // this event has been handled already stDebug("s-task:%s not handle event:%s yet, wait for 100ms and recheck", id, StreamTaskEventList[event].name); taosMsleep(100); + } else { + stDebug("s-task:%s is dropped or stopped already, not wait.", id); + return TSDB_CODE_INVALID_PARA; } }