From 94f703889df3c56e89249546319854438c6aa3c3 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Wed, 3 Apr 2024 12:42:53 +0800 Subject: [PATCH 1/4] fix(stream): remove invalid assert. --- source/libs/stream/src/streamStart.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/libs/stream/src/streamStart.c b/source/libs/stream/src/streamStart.c index cb340ade32..0161f382ba 100644 --- a/source/libs/stream/src/streamStart.c +++ b/source/libs/stream/src/streamStart.c @@ -119,7 +119,11 @@ int32_t streamReExecScanHistoryFuture(SStreamTask* pTask, int32_t idleDuration) // add ref for task SStreamTask* p = streamMetaAcquireTask(pTask->pMeta, pTask->id.streamId, pTask->id.taskId); - ASSERT(p != NULL); + if (p == NULL) { + stError("s-task:0x%x failed to acquire task, status:%s, not exec scan-history data", pTask->id.taskId, + streamTaskGetStatus(pTask)->name); + return TSDB_CODE_SUCCESS; + } pTask->schedHistoryInfo.numOfTicks = numOfTicks; From 1b343e662c0ac1e74bd731935b77b67f4be9349e Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Sun, 7 Apr 2024 10:18:01 +0800 Subject: [PATCH 2/4] fix(stream): retry stop timer for trigger tmr. --- source/libs/stream/src/streamTask.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/source/libs/stream/src/streamTask.c b/source/libs/stream/src/streamTask.c index c7a1a00a46..c610e86322 100644 --- a/source/libs/stream/src/streamTask.c +++ b/source/libs/stream/src/streamTask.c @@ -375,17 +375,22 @@ void tFreeStreamTask(SStreamTask* pTask) { } if (pTask->schedInfo.pDelayTimer != NULL) { - taosTmrStop(pTask->schedInfo.pDelayTimer); + while(!taosTmrStop(pTask->schedInfo.pDelayTimer)) { + stError("failed to stop the trigger sched timer, wait for 100ms and retry"); + taosMsleep(100); + } pTask->schedInfo.pDelayTimer = NULL; } if (pTask->hTaskInfo.pTimer != NULL) { - taosTmrStop(pTask->hTaskInfo.pTimer); + bool ret = taosTmrStop(pTask->hTaskInfo.pTimer); + ASSERT(ret); pTask->hTaskInfo.pTimer = NULL; } if (pTask->msgInfo.pTimer != NULL) { - taosTmrStop(pTask->msgInfo.pTimer); + bool ret = taosTmrStop(pTask->msgInfo.pTimer); + ASSERT(ret); pTask->msgInfo.pTimer = NULL; } From f82505ba1661d186394ae75163eab2dabf53a3a5 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Sun, 7 Apr 2024 14:06:25 +0800 Subject: [PATCH 3/4] fix(stream): remove invalid assert --- source/libs/stream/src/streamTask.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/source/libs/stream/src/streamTask.c b/source/libs/stream/src/streamTask.c index c610e86322..113983806b 100644 --- a/source/libs/stream/src/streamTask.c +++ b/source/libs/stream/src/streamTask.c @@ -383,14 +383,12 @@ void tFreeStreamTask(SStreamTask* pTask) { } if (pTask->hTaskInfo.pTimer != NULL) { - bool ret = taosTmrStop(pTask->hTaskInfo.pTimer); - ASSERT(ret); + /*bool ret = */taosTmrStop(pTask->hTaskInfo.pTimer); pTask->hTaskInfo.pTimer = NULL; } if (pTask->msgInfo.pTimer != NULL) { - bool ret = taosTmrStop(pTask->msgInfo.pTimer); - ASSERT(ret); + /*bool ret = */taosTmrStop(pTask->msgInfo.pTimer); pTask->msgInfo.pTimer = NULL; } From fb58ca8592724b106aa1d322b769b79227fdd385 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Sun, 7 Apr 2024 18:53:25 +0800 Subject: [PATCH 4/4] fix(stream): not wait for the timer stopped. --- source/libs/stream/src/streamTask.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/source/libs/stream/src/streamTask.c b/source/libs/stream/src/streamTask.c index 113983806b..44f70f8b19 100644 --- a/source/libs/stream/src/streamTask.c +++ b/source/libs/stream/src/streamTask.c @@ -375,10 +375,7 @@ void tFreeStreamTask(SStreamTask* pTask) { } if (pTask->schedInfo.pDelayTimer != NULL) { - while(!taosTmrStop(pTask->schedInfo.pDelayTimer)) { - stError("failed to stop the trigger sched timer, wait for 100ms and retry"); - taosMsleep(100); - } + taosTmrStop(pTask->schedInfo.pDelayTimer); pTask->schedInfo.pDelayTimer = NULL; }