diff --git a/source/client/src/clientMonitor.c b/source/client/src/clientMonitor.c index a102995c0d..479ea76fe3 100644 --- a/source/client/src/clientMonitor.c +++ b/source/client/src/clientMonitor.c @@ -307,6 +307,11 @@ end: void monitorCounterInc(int64_t clusterId, const char* counterName, const char** label_values) { taosWLockLatch(&monitorLock); + if (atomic_load_32(&monitorFlag) == 1) { + taosRUnLockLatch(&monitorLock); + return; + } + MonitorClient** ppMonitor = (MonitorClient**)taosHashGet(monitorCounterHash, &clusterId, LONG_BYTES); if (ppMonitor == NULL || *ppMonitor == NULL) { tscError("monitorCounterInc not found pMonitor %"PRId64, clusterId);