From 85e87e02a7901b973f178436ca87c814a8ff6d9c Mon Sep 17 00:00:00 2001 From: Jeff Tao Date: Wed, 30 Sep 2020 00:19:17 +0000 Subject: [PATCH] TD-1628 --- src/rpc/src/rpcCache.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/rpc/src/rpcCache.c b/src/rpc/src/rpcCache.c index 751f03e52a..46b0d4e3bb 100644 --- a/src/rpc/src/rpcCache.c +++ b/src/rpc/src/rpcCache.c @@ -216,6 +216,7 @@ static void rpcCleanConnCache(void *handle, void *tmrId) { if (pCache == NULL || pCache->maxSessions == 0) return; if (pCache->pTimer != tmrId) return; + pthread_mutex_lock(&pCache->mutex); uint64_t time = taosGetTimestampMs(); for (hash = 0; hash < pCache->maxSessions; ++hash) { @@ -227,6 +228,7 @@ static void rpcCleanConnCache(void *handle, void *tmrId) { // tTrace("timer, total connections in cache:%d", pCache->total); taosTmrReset(rpcCleanConnCache, (int32_t)(pCache->keepTimer * 2), pCache, pCache->tmrCtrl, &pCache->pTimer); + pthread_mutex_unlock(&pCache->mutex); } static void rpcRemoveExpiredNodes(SConnCache *pCache, SConnHash *pNode, int hash, uint64_t time) { -- GitLab