fix:check if queue is closed before send data to queue in monitor
This commit is contained in:
parent
3236907467
commit
020900e359
|
@ -682,7 +682,7 @@ static void* monitorThreadFunc(void *param){
|
||||||
tscDebug("monitorThreadFunc start");
|
tscDebug("monitorThreadFunc start");
|
||||||
int64_t quitTime = 0;
|
int64_t quitTime = 0;
|
||||||
while (1) {
|
while (1) {
|
||||||
if (slowLogFlag > 0) {
|
if (atomic_load_32(&slowLogFlag) > 0 > 0) {
|
||||||
if(quitCnt == 0){
|
if(quitCnt == 0){
|
||||||
monitorSendAllSlowLogAtQuit();
|
monitorSendAllSlowLogAtQuit();
|
||||||
if(quitCnt == 0){
|
if(quitCnt == 0){
|
||||||
|
@ -727,10 +727,7 @@ static void* monitorThreadFunc(void *param){
|
||||||
}
|
}
|
||||||
tsem2_timewait(&monitorSem, 100);
|
tsem2_timewait(&monitorSem, 100);
|
||||||
}
|
}
|
||||||
|
atomic_store_32(&slowLogFlag, -2);
|
||||||
taosCloseQueue(monitorQueue);
|
|
||||||
tsem2_destroy(&monitorSem);
|
|
||||||
slowLogFlag = -2;
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -826,10 +823,16 @@ void monitorClose() {
|
||||||
taosHashCleanup(monitorCounterHash);
|
taosHashCleanup(monitorCounterHash);
|
||||||
taosHashCleanup(monitorSlowLogHash);
|
taosHashCleanup(monitorSlowLogHash);
|
||||||
taosTmrCleanUp(monitorTimer);
|
taosTmrCleanUp(monitorTimer);
|
||||||
|
taosCloseQueue(monitorQueue);
|
||||||
|
tsem2_destroy(&monitorSem);
|
||||||
taosWUnLockLatch(&monitorLock);
|
taosWUnLockLatch(&monitorLock);
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t monitorPutData2MonitorQueue(MonitorSlowLogData data){
|
int32_t monitorPutData2MonitorQueue(MonitorSlowLogData data){
|
||||||
|
if (atomic_load_32(&slowLogFlag) == -2) {
|
||||||
|
tscError("[monitor] slow log thread is exiting");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
MonitorSlowLogData* slowLogData = taosAllocateQitem(sizeof(MonitorSlowLogData), DEF_QITEM, 0);
|
MonitorSlowLogData* slowLogData = taosAllocateQitem(sizeof(MonitorSlowLogData), DEF_QITEM, 0);
|
||||||
if (slowLogData == NULL) {
|
if (slowLogData == NULL) {
|
||||||
tscError("[monitor] failed to allocate slow log data");
|
tscError("[monitor] failed to allocate slow log data");
|
||||||
|
|
Loading…
Reference in New Issue