fix limit

This commit is contained in:
yihaoDeng 2024-10-24 07:54:53 +08:00
parent b5bea47883
commit 2630987e5e
1 changed files with 6 additions and 2 deletions

View File

@ -858,7 +858,6 @@ static int32_t cliGetConnFromPool(SCliThrd* pThrd, const char* key, SCliConn** p
if (plist->totalSize >= pInst->connLimitNum) {
return TSDB_CODE_RPC_MAX_SESSIONS;
}
plist->totalSize += 1;
return TSDB_CODE_RPC_NETWORK_BUSY;
}
@ -1548,10 +1547,15 @@ static int32_t cliDoConn(SCliThrd* pThrd, SCliConn* conn) {
}
transRefCliHandle(conn);
conn->list = taosHashGet((SHashObj*)pThrd->pool, conn->dstAddr, strlen(conn->dstAddr));
if (conn->list != NULL) {
conn->list->totalSize += 1;
}
ret = uv_tcp_connect(&conn->connReq, (uv_tcp_t*)(conn->stream), (const struct sockaddr*)&addr, cliConnCb);
if (ret != 0) {
tError("failed connect to %s since %s", conn->dstAddr, uv_err_name(ret));
TAOS_CHECK_GOTO(TSDB_CODE_THIRDPARTY_ERROR, &lino, _exception1);
}