From 87f52c88d91ff79913e8310075b641b15cd26c13 Mon Sep 17 00:00:00 2001 From: Shungang Li Date: Tue, 14 May 2024 10:45:13 +0800 Subject: [PATCH] fix: race condition in dumpConfToDataBlock --- source/common/src/tmisce.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/common/src/tmisce.c b/source/common/src/tmisce.c index 0a9e8f434b..d2b52b201e 100644 --- a/source/common/src/tmisce.c +++ b/source/common/src/tmisce.c @@ -228,6 +228,8 @@ int32_t dumpConfToDataBlock(SSDataBlock* pBlock, int32_t startCol) { blockDataEnsureCapacity(pBlock, cfgGetSize(pConf)); SConfigIter* pIter = cfgCreateIter(pConf); + cfgLock(pConf); + while ((pItem = cfgNextIter(pIter)) != NULL) { col = startCol; @@ -253,6 +255,8 @@ int32_t dumpConfToDataBlock(SSDataBlock* pBlock, int32_t startCol) { numOfRows++; } + cfgUnLock(pConf); + pBlock->info.rows = numOfRows; cfgDestroyIter(pIter);