fix invalid code

This commit is contained in:
yihaoDeng 2023-02-17 13:56:42 +08:00
parent 3de71e39b4
commit d22e97d256
2 changed files with 12 additions and 10 deletions

View File

@ -284,9 +284,9 @@ int32_t dmInitClient(SDnode *pDnode) {
rpcInit.failFastThreshold = 3; // failed threshold rpcInit.failFastThreshold = 3; // failed threshold
rpcInit.ffp = dmFailFastFp; rpcInit.ffp = dmFailFastFp;
int32_t connLimitNum = 30000 / (tsNumOfRpcThreads * 3); int32_t connLimitNum = 10000 / (tsNumOfRpcThreads * 3);
connLimitNum = TMAX(connLimitNum, 500); connLimitNum = TMAX(connLimitNum, 100);
connLimitNum = TMIN(connLimitNum, 1000); connLimitNum = TMIN(connLimitNum, 600);
rpcInit.connLimitNum = connLimitNum; rpcInit.connLimitNum = connLimitNum;
rpcInit.connLimitLock = 1; rpcInit.connLimitLock = 1;

View File

@ -1070,22 +1070,24 @@ static void cliHandleBatchReq(SCliBatch* pBatch, SCliThrd* pThrd) {
cliSendBatch(conn); cliSendBatch(conn);
} }
static void cliSendBatchCb(uv_write_t* req, int status) { static void cliSendBatchCb(uv_write_t* req, int status) {
SCliConn* conn = req->data; SCliConn* conn = req->data;
taosMemoryFree(req); SCliThrd* thrd = conn->hostThrd;
SCliBatch* p = conn->pBatch;
SCliThrd* thrd = conn->hostThrd;
cliDestroyBatch(conn->pBatch);
conn->pBatch = NULL; conn->pBatch = NULL;
if (status != 0) { if (status != 0) {
tDebug("%p conn %p failed to send batch msg, batch size:%d, msgLen:%d, reason:%s", CONN_GET_INST_LABEL(conn), conn, tDebug("%p conn %p failed to send batch msg, batch size:%d, msgLen:%d, reason:%s", CONN_GET_INST_LABEL(conn), conn,
conn->pBatch->wLen, conn->pBatch->batchSize, uv_err_name(status)); p->wLen, p->batchSize, uv_err_name(status));
cliHandleExcept(conn); cliHandleExcept(conn);
} else { } else {
tDebug("%p conn %p succ to send batch msg, batch size:%d, msgLen:%d", CONN_GET_INST_LABEL(conn), conn, tDebug("%p conn %p succ to send batch msg, batch size:%d, msgLen:%d", CONN_GET_INST_LABEL(conn), conn, p->wLen,
conn->pBatch->wLen, conn->pBatch->batchSize); p->batchSize);
addConnToPool(thrd->pool, conn); addConnToPool(thrd->pool, conn);
} }
cliDestroyBatch(p);
taosMemoryFree(req);
} }
static void cliHandleFastFail(SCliConn* pConn, int status) { static void cliHandleFastFail(SCliConn* pConn, int status) {
SCliThrd* pThrd = pConn->hostThrd; SCliThrd* pThrd = pConn->hostThrd;