add config

This commit is contained in:
yihaoDeng 2024-10-01 10:17:47 +08:00
parent 947e1d2fc4
commit 3ab4726651
1 changed files with 2 additions and 1 deletions

View File

@ -3616,7 +3616,8 @@ static FORCE_INLINE int8_t shouldSWitchToOtherConn(SCliConn* pConn, char* key) {
int32_t stateNum = taosHashGetSize(pConn->pQTable);
int32_t totalReqs = reqsNum + reqsSentOut;
if (stateNum >= pInst->shareConnLimit || totalReqs >= pInst->shareConnLimit) {
if (((totalReqs >= pInst->shareConnLimit / 2) && (stateNum >= pInst->shareConnLimit)) ||
totalReqs >= pInst->shareConnLimit) {
if (pConn->list == NULL && pConn->dstAddr != NULL) {
pConn->list = taosHashGet((SHashObj*)pThrd->pool, pConn->dstAddr, strlen(pConn->dstAddr));
if (pConn->list != NULL) {