From 44d81eab56a3e359c237cf4ce293758f3698a836 Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Tue, 2 Jul 2024 18:45:12 +0800 Subject: [PATCH] fix:remove using alarm when sending slow log & use one thread to send all slow log --- source/client/src/clientMonitor.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/client/src/clientMonitor.c b/source/client/src/clientMonitor.c index 3752aa64a4..b603676ee8 100644 --- a/source/client/src/clientMonitor.c +++ b/source/client/src/clientMonitor.c @@ -659,7 +659,7 @@ static void monitorSendAllSlowLogFromTempDir(int64_t clusterId){ char filename[PATH_MAX] = {0}; snprintf(filename, sizeof(filename), "%s%s", tmpPath, name); - TdFilePtr pFile = taosOpenFile(filename, TD_FILE_READ | TD_FILE_TRUNC); + TdFilePtr pFile = taosOpenFile(filename, TD_FILE_READ | TD_FILE_WRITE); if (pFile == NULL) { uError("failed to open file:%s since %s", filename, terrstr()); continue; @@ -748,6 +748,8 @@ static void* monitorThreadFunc(void *param){ }else if(slowLogData->type == SLOW_LOG_READ_QUIT){ if(monitorSendSlowLogAtQuit(slowLogData->clusterId)){ uInfo("monitorThreadFunc quit since all slow log sended"); + monitorFreeSlowLogData(slowLogData); + taosFreeQitem(slowLogData); break; } }