fix:[TS-4921]refactor reporting logic for slow log

This commit is contained in:
wangmm0220 2024-07-02 18:03:26 +08:00
parent 3b6cb21771
commit 470796ae88
2 changed files with 4 additions and 1 deletions

View File

@ -35,7 +35,7 @@ typedef enum {
SLOW_LOG_WRITE = 0,
SLOW_LOG_READ_RUNNING = 1,
SLOW_LOG_READ_BEGINNIG = 2,
SLOW_LOG_READ_QUIT = 2,
SLOW_LOG_READ_QUIT = 3,
} SLOW_LOG_QUEUE_TYPE;
#define SLOW_LOG_SEND_SIZE_MAX 128*1024*1024

View File

@ -717,11 +717,13 @@ static void* monitorThreadFunc(void *param){
if(quitCnt == 0){
monitorSendAllSlowLogAtQuit();
if(quitCnt == 0){
uInfo("monitorThreadFunc quit since no slow log to send");
break;
}
quitTime = taosGetMonoTimestampMs();
}
if(taosGetMonoTimestampMs() - quitTime > 500){ //quit at most 500ms
uInfo("monitorThreadFunc quit since timeout")
break;
}
}
@ -745,6 +747,7 @@ static void* monitorThreadFunc(void *param){
monitorSendSlowLogAtRunning(slowLogData->clusterId);
}else if(slowLogData->type == SLOW_LOG_READ_QUIT){
if(monitorSendSlowLogAtQuit(slowLogData->clusterId)){
uInfo("monitorThreadFunc quit since all slow log sended");
break;
}
}