From ce2b2bb024ac61e93d28bf770ca7c5734043abfd Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Fri, 15 Nov 2024 18:15:50 +0800 Subject: [PATCH] fix: race condition issue --- source/util/test/memPoolTest.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source/util/test/memPoolTest.cpp b/source/util/test/memPoolTest.cpp index 5813530810..1fecb10b47 100644 --- a/source/util/test/memPoolTest.cpp +++ b/source/util/test/memPoolTest.cpp @@ -1064,9 +1064,6 @@ void mptCheckPoolUsedSize(int32_t jobNum) { for (int32_t i = 0; i < jobNum; ++i) { SMPTestJobCtx* pJobCtx = &mptCtx.jobCtxs[i]; - if (NULL == pJobCtx->pJob) { - continue; - } sleepTimes = 0; while (taosRTryLockLatch(&pJobCtx->jobExecLock)) { @@ -1081,6 +1078,10 @@ void mptCheckPoolUsedSize(int32_t jobNum) { break; } + if (NULL == pJobCtx->pJob) { + continue; + } + int64_t jobUsedSize = 0; for (int32_t m = 0; m < pJobCtx->taskNum; ++m) { if (!pJobCtx->taskCtxs[m].destoryed) {