From 54bae9d592399fb3635a3b2dec74d81c37421e35 Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Wed, 9 Oct 2024 19:59:28 +0800 Subject: [PATCH] add config --- source/libs/transport/src/transCli.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/source/libs/transport/src/transCli.c b/source/libs/transport/src/transCli.c index 4bb0ede629..938247766e 100644 --- a/source/libs/transport/src/transCli.c +++ b/source/libs/transport/src/transCli.c @@ -1102,7 +1102,6 @@ static void cliDestroy(uv_handle_t* handle) { if (uv_handle_get_type(handle) != UV_TCP || handle->data == NULL) { return; } - SCliConn* conn = handle->data; SCliThrd* pThrd = conn->hostThrd; cliResetConnTimer(conn); @@ -1223,6 +1222,11 @@ static void cliHandleException(SCliConn* conn) { conn->list = NULL; } + if (conn->task != NULL) { + transDQCancel(((SCliThrd*)conn->hostThrd)->timeoutQueue, conn->task); + conn->task = NULL; + } + if (conn->registered) { int8_t ref = transGetRefCount(conn); if (ref == 0 && !uv_is_closing((uv_handle_t*)conn->stream)) { @@ -3667,8 +3671,7 @@ static FORCE_INLINE int8_t shouldSWitchToOtherConn(SCliConn* pConn, char* key) { int32_t stateNum = taosHashGetSize(pConn->pQTable); int32_t totalReqs = reqsNum + reqsSentOut; - if (((totalReqs >= pInst->shareConnLimit / 2) && (stateNum >= pInst->shareConnLimit)) || - totalReqs >= pInst->shareConnLimit) { + if (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) {