From 46ca55ac749402879aac775904757866d50a7c88 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Wed, 29 May 2024 15:20:35 +0800 Subject: [PATCH] fix(stream): avoid deadlock. --- source/libs/stream/src/streamCheckpoint.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/libs/stream/src/streamCheckpoint.c b/source/libs/stream/src/streamCheckpoint.c index 3865d030f5..76bf139c3f 100644 --- a/source/libs/stream/src/streamCheckpoint.c +++ b/source/libs/stream/src/streamCheckpoint.c @@ -309,12 +309,15 @@ int32_t streamTaskUpdateTaskCheckpointInfo(SStreamTask* pTask, SVUpdateCheckpoin { // destroy the related fill-history tasks // drop task should not in the meta-lock, and drop the related fill-history task now + streamMetaWUnLock(pMeta); if (pReq->dropRelHTask) { streamMetaUnregisterTask(pMeta, pReq->hStreamId, pReq->hTaskId); int32_t numOfTasks = streamMetaGetNumOfTasks(pMeta); stDebug("s-task:%s vgId:%d related fill-history task:0x%x dropped in update checkpointInfo, remain tasks:%d", id, vgId, pReq->taskId, numOfTasks); } + + streamMetaWLock(pMeta); } return TSDB_CODE_SUCCESS;