From d3fcab5c0d1ebcf7edd21ecb22839421868d5448 Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Tue, 2 Jul 2024 16:19:02 +0800 Subject: [PATCH] fix:[TS-4921]refactor reporting logic for slow log --- source/client/src/clientMonitor.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/source/client/src/clientMonitor.c b/source/client/src/clientMonitor.c index 5fb1d25ba4..f9a9b12bea 100644 --- a/source/client/src/clientMonitor.c +++ b/source/client/src/clientMonitor.c @@ -427,7 +427,7 @@ static char* readFile(TdFilePtr pFile, int64_t *offset, int64_t size){ *offset += (len+1); } - uDebug("[monitor] monitorReadSendSlowLog slow log:%s", pCont); + uDebug("[monitor] readFile slow log:%s", pCont); return pCont; } @@ -693,6 +693,9 @@ static void* monitorThreadFunc(void *param){ if (slowLogFlag > 0) { if(quitCnt == 0){ monitorSendAllSlowLogAtQuit(); + if(quitCnt == 0){ + break; + } quitTime = taosGetMonoTimestampMs(); } if(taosGetMonoTimestampMs() - quitTime > 500){ //quit at most 500ms @@ -726,7 +729,9 @@ static void* monitorThreadFunc(void *param){ monitorFreeSlowLogData(slowLogData); taosFreeQitem(slowLogData); - monitorSendAllSlowLog(); + if (quitCnt == 0) { + monitorSendAllSlowLog(); + } tsem2_timewait(&monitorSem, 100); }