diff --git a/source/libs/catalog/src/catalog.c b/source/libs/catalog/src/catalog.c index bc1462176a..a0a4cb301c 100644 --- a/source/libs/catalog/src/catalog.c +++ b/source/libs/catalog/src/catalog.c @@ -1986,10 +1986,17 @@ void catalogDestroy(void) { } if (gCtgMgmt.cacheTimer) { - if (taosTmrStop(gCtgMgmt.cacheTimer)) { - qTrace("stop catalog cache timer may failed"); + if (!taosTmrStop(gCtgMgmt.cacheTimer)) { + qDebug("catalog cacheTimer %" PRIuPTR " not stopped", (uintptr_t)gCtgMgmt.cacheTimer); + + while (!taosTmrIsStopped(&gCtgMgmt.cacheTimer)) { + taosMsleep(1); + } } + + qDebug("catalog cacheTimer %" PRIuPTR " is stopped", (uintptr_t)gCtgMgmt.cacheTimer); gCtgMgmt.cacheTimer = NULL; + taosTmrCleanUp(gCtgMgmt.timer); gCtgMgmt.timer = NULL; } diff --git a/source/libs/catalog/test/catalogTests.cpp b/source/libs/catalog/test/catalogTests.cpp index c2889f096b..06eabc09da 100644 --- a/source/libs/catalog/test/catalogTests.cpp +++ b/source/libs/catalog/test/catalogTests.cpp @@ -149,12 +149,13 @@ void ctgTestInitLogFile() { return; } - const char *defaultLogFileNamePrefix = "taoslog"; + const char *defaultLogFileNamePrefix = "catalogTest"; const int32_t maxLogFileNum = 10; tsAsyncLog = 0; qDebugFlag = 159; tmrDebugFlag = 159; + tsNumOfLogLines = 1000000000; TAOS_STRCPY(tsLogDir, TD_LOG_DIR_PATH); (void)ctgdEnableDebug("api", true); @@ -1839,7 +1840,7 @@ TEST(tableMeta, updateStbMeta) { while (true) { uint64_t n = 0; ASSERT(0 == ctgdGetStatNum("runtime.numOfOpDequeue", (void *)&n)); - if (n != 3) { + if (n < 3) { taosMsleep(50); } else { break;