From 79688e32a3213294f3b9f2cded435bde9d56a446 Mon Sep 17 00:00:00 2001 From: Yihao Deng Date: Thu, 29 Aug 2024 09:54:28 +0000 Subject: [PATCH 1/2] add debug info --- source/libs/stream/src/streamTask.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/libs/stream/src/streamTask.c b/source/libs/stream/src/streamTask.c index afe315bf58..76db09731f 100644 --- a/source/libs/stream/src/streamTask.c +++ b/source/libs/stream/src/streamTask.c @@ -310,6 +310,7 @@ void tFreeStreamTask(SStreamTask* pTask) { } void streamFreeTaskState(SStreamTask* pTask, int8_t remove) { + stDebug("s-task:0x%x start to free task state/backend", pTask->id.taskId); if (pTask->pState != NULL) { stDebug("s-task:0x%x start to free task state", pTask->id.taskId); streamStateClose(pTask->pState, remove); @@ -319,8 +320,11 @@ void streamFreeTaskState(SStreamTask* pTask, int8_t remove) { pTask->pBackend = NULL; pTask->pState = NULL; } else { + stDebug("s-task:0x%x task state is NULL, may del backend:%s", pTask->id.taskId, + pTask->backendPath ? pTask->backendPath : "NULL"); if (remove) { if (pTask->backendPath != NULL) { + stDebug("s-task:0x%x task state is NULL, do del backend:%s", pTask->id.taskId, pTask->backendPath); taosRemoveDir(pTask->backendPath); } } @@ -393,6 +397,7 @@ int32_t streamTaskSetBackendPath(SStreamTask* pTask) { } (void)sprintf(pTask->backendPath, "%s%s%s", pTask->pMeta->path, TD_DIRSEP, id); + stDebug("s-task:%s set backend path:%s", pTask->id.idStr, pTask->backendPath); return 0; } From b4821224c6e1c224a33c9d5da83326b9d1a6e480 Mon Sep 17 00:00:00 2001 From: Yihao Deng Date: Thu, 29 Aug 2024 11:28:59 +0000 Subject: [PATCH 2/2] force remve stream path --- source/libs/stream/src/streamTask.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/libs/stream/src/streamTask.c b/source/libs/stream/src/streamTask.c index 76db09731f..3b7b999dcb 100644 --- a/source/libs/stream/src/streamTask.c +++ b/source/libs/stream/src/streamTask.c @@ -377,11 +377,11 @@ int32_t streamTaskSetBackendPath(SStreamTask* pTask) { int32_t taskId = 0; if (pTask->info.fillHistory) { - streamId = pTask->hTaskInfo.id.taskId; - taskId = pTask->hTaskInfo.id.taskId; - } else { - streamId = pTask->streamTaskId.taskId; + streamId = pTask->streamTaskId.streamId; taskId = pTask->streamTaskId.taskId; + } else { + streamId = pTask->id.streamId; + taskId = pTask->id.taskId; } char id[128] = {0};