From a6594efd78daa09f848942f1b77a502b574c545d Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Sat, 19 Dec 2020 10:50:54 +0800 Subject: [PATCH] [TD-225]fix concurrent issue in query handle managment. --- src/query/src/qExecutor.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/query/src/qExecutor.c b/src/query/src/qExecutor.c index a95ee8924c..95a2949950 100644 --- a/src/query/src/qExecutor.c +++ b/src/query/src/qExecutor.c @@ -7981,9 +7981,9 @@ void qQueryMgmtNotifyClosed(void* pQMgmt) { SQueryMgmt* pQueryMgmt = pQMgmt; qDebug("vgId:%d, set querymgmt closed, wait for all queries cancelled", pQueryMgmt->vgId); -// pthread_mutex_lock(&pQueryMgmt->lock); + pthread_mutex_lock(&pQueryMgmt->lock); pQueryMgmt->closed = true; -// pthread_mutex_unlock(&pQueryMgmt->lock); + pthread_mutex_unlock(&pQueryMgmt->lock); taosCacheRefresh(pQueryMgmt->qinfoPool, queryMgmtKillQueryFn); } @@ -8021,9 +8021,9 @@ void** qRegisterQInfo(void* pMgmt, uint64_t qInfo) { return NULL; } -// pthread_mutex_lock(&pQueryMgmt->lock); + pthread_mutex_lock(&pQueryMgmt->lock); if (pQueryMgmt->closed) { -// pthread_mutex_unlock(&pQueryMgmt->lock); + pthread_mutex_unlock(&pQueryMgmt->lock); qError("QInfo:%p failed to add qhandle into cache, since qMgmt is colsing", (void *)qInfo); terrno = TSDB_CODE_VND_INVALID_VGROUP_ID; return NULL; @@ -8031,7 +8031,7 @@ void** qRegisterQInfo(void* pMgmt, uint64_t qInfo) { TSDB_CACHE_PTR_TYPE handleVal = (TSDB_CACHE_PTR_TYPE) qInfo; void** handle = taosCachePut(pQueryMgmt->qinfoPool, &handleVal, sizeof(TSDB_CACHE_PTR_TYPE), &qInfo, sizeof(TSDB_CACHE_PTR_TYPE), (getMaximumIdleDurationSec()*1000)); -// pthread_mutex_unlock(&pQueryMgmt->lock); + pthread_mutex_unlock(&pQueryMgmt->lock); return handle; } -- GitLab