recycle threads slower

This commit is contained in:
wangjiaming0909 2024-06-26 13:47:51 +08:00 committed by wangjiaming0909
parent 11a98ffab2
commit 938dc06a09
1 changed files with 2 additions and 3 deletions

View File

@ -618,7 +618,7 @@ bool tQueryAutoQWorkerTryRecycleWorker(SQueryAutoQWorkerPool* pPool, SQueryAutoQ
tdListPopNode(pPool->workers, pNode);
// reclaim some workers
if (pWorker->id >= pPool->num * 2 ) {
while (listNEles(pPool->exitedWorkers) > 0) {
while (listNEles(pPool->exitedWorkers) > pPool->num) {
SListNode* head = tdListPopHead(pPool->exitedWorkers);
SQueryAutoQWorker* pWorker = (SQueryAutoQWorker*)head->data;
if (pWorker && taosCheckPthreadValid(pWorker->thread)) {
@ -640,7 +640,6 @@ bool tQueryAutoQWorkerTryRecycleWorker(SQueryAutoQWorkerPool* pPool, SQueryAutoQ
taosThreadMutexLock(&pPool->backupLock);
atomic_fetch_add_32(&pPool->backupNum, 1);
if (!pPool->exit) taosThreadCondWait(&pPool->backupCond, &pPool->backupLock);
// TODO wjm what if taosd is exiting
taosThreadMutexUnlock(&pPool->backupLock);
// recovered from backup