diff --git a/source/libs/nodes/src/nodesUtilFuncs.c b/source/libs/nodes/src/nodesUtilFuncs.c index e647438800..aec4d0148a 100644 --- a/source/libs/nodes/src/nodesUtilFuncs.c +++ b/source/libs/nodes/src/nodesUtilFuncs.c @@ -190,28 +190,20 @@ int32_t nodesReleaseAllocator(int64_t allocatorId) { return TSDB_CODE_SUCCESS; } - SNodeAllocator* pAllocator = taosAcquireRef(g_allocatorReqRefPool, allocatorId); - if (NULL == pAllocator) { - return terrno; - } - - int32_t code = taosThreadMutexTryLock(&pAllocator->mutex); - if (EBUSY != code) { + if (NULL == g_pNodeAllocator) { nodesError("allocator id %" PRIx64 " release failed: The nodesReleaseAllocator function needs to be called after the nodesAcquireAllocator " "function is called!", allocatorId); - if (0 == code) { - taosThreadMutexUnlock(&pAllocator->mutex); - } return TSDB_CODE_FAILED; } - + SNodeAllocator* pAllocator = g_pNodeAllocator; g_pNodeAllocator = NULL; taosThreadMutexUnlock(&pAllocator->mutex); return taosReleaseRef(g_allocatorReqRefPool, allocatorId); } + int64_t nodesMakeAllocatorWeakRef(int64_t allocatorId) { if (allocatorId <= 0) { return 0;