未验证 提交 d09cc3be 编写于 作者: S Shengliang Guan 提交者: GitHub

Merge pull request #3734 from taosdata/patch/TD-1628

TD-1628
...@@ -216,6 +216,7 @@ static void rpcCleanConnCache(void *handle, void *tmrId) { ...@@ -216,6 +216,7 @@ static void rpcCleanConnCache(void *handle, void *tmrId) {
if (pCache == NULL || pCache->maxSessions == 0) return; if (pCache == NULL || pCache->maxSessions == 0) return;
if (pCache->pTimer != tmrId) return; if (pCache->pTimer != tmrId) return;
pthread_mutex_lock(&pCache->mutex);
uint64_t time = taosGetTimestampMs(); uint64_t time = taosGetTimestampMs();
for (hash = 0; hash < pCache->maxSessions; ++hash) { for (hash = 0; hash < pCache->maxSessions; ++hash) {
...@@ -227,6 +228,7 @@ static void rpcCleanConnCache(void *handle, void *tmrId) { ...@@ -227,6 +228,7 @@ static void rpcCleanConnCache(void *handle, void *tmrId) {
// tTrace("timer, total connections in cache:%d", pCache->total); // tTrace("timer, total connections in cache:%d", pCache->total);
taosTmrReset(rpcCleanConnCache, (int32_t)(pCache->keepTimer * 2), pCache, pCache->tmrCtrl, &pCache->pTimer); 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) { static void rpcRemoveExpiredNodes(SConnCache *pCache, SConnHash *pNode, int hash, uint64_t time) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册