diff --git a/source/libs/stream/src/streamTask.c b/source/libs/stream/src/streamTask.c index c531260682..b7b54e2885 100644 --- a/source/libs/stream/src/streamTask.c +++ b/source/libs/stream/src/streamTask.c @@ -298,14 +298,6 @@ void tFreeStreamTask(SStreamTask* pTask) { taosArrayDestroy(pTask->outputInfo.pNodeEpsetUpdateList); pTask->outputInfo.pNodeEpsetUpdateList = NULL; - // if ((pTask->status.removeBackendFiles) && (pTask->pMeta != NULL)) { - // char* path = taosMemoryCalloc(1, strlen(pTask->pMeta->path) + 128); - // sprintf(path, "%s%s%s", pTask->pMeta->path, TD_DIRSEP, pTask->id.idStr); - // taosRemoveDir(path); - - // stInfo("s-task:0x%x vgId:%d remove all backend files:%s", taskId, pTask->pMeta->vgId, path); - // taosMemoryFree(path); - // } if (pTask->id.idStr != NULL) { taosMemoryFree((void*)pTask->id.idStr); @@ -328,6 +320,11 @@ void streamFreeTaskState(SStreamTask* pTask, int8_t remove) { taskDbRemoveRef(pTask->pBackend); pTask->pBackend = NULL; pTask->pState = NULL; + + if (pTask->backendPath != NULL) { + taosMemoryFree(pTask->backendPath); + pTask->backendPath = NULL; + } } else { if (remove) { if (pTask->backendPath != NULL) {