add config

This commit is contained in:
yihaoDeng 2024-10-09 21:47:51 +08:00
parent 1ba3178a85
commit d4e24280e3
1 changed files with 6 additions and 3 deletions

View File

@ -422,14 +422,17 @@ void cliConnMayUpdateTimer(SCliConn* conn, int64_t timeout) {
} }
void destroyCliConnQTable(SCliConn* conn) { void destroyCliConnQTable(SCliConn* conn) {
int32_t code = 0; SCliThrd* thrd = conn->hostThrd;
void* pIter = taosHashIterate(conn->pQTable, NULL); int32_t code = 0;
void* pIter = taosHashIterate(conn->pQTable, NULL);
while (pIter != NULL) { while (pIter != NULL) {
int64_t* qid = taosHashGetKey(pIter, NULL); int64_t* qid = taosHashGetKey(pIter, NULL);
STransCtx* ctx = pIter; STransCtx* ctx = pIter;
transCtxCleanup(ctx); transCtxCleanup(ctx);
pIter = taosHashIterate(conn->pQTable, pIter); pIter = taosHashIterate(conn->pQTable, pIter);
TAOS_UNUSED(taosHashRemove(thrd->pIdConnTable, qid, sizeof(*qid)));
transReleaseExHandle(transGetRefMgt(), *qid); transReleaseExHandle(transGetRefMgt(), *qid);
transRemoveExHandle(transGetRefMgt(), *qid); transRemoveExHandle(transGetRefMgt(), *qid);
} }
@ -996,6 +999,7 @@ static int32_t cliCreateConn(SCliThrd* pThrd, SCliConn** pCliConn, char* ip, int
char addr[TSDB_FQDN_LEN + 64] = {0}; char addr[TSDB_FQDN_LEN + 64] = {0};
CONN_CONSTRUCT_HASH_KEY(addr, ip, port); CONN_CONSTRUCT_HASH_KEY(addr, ip, port);
conn->hostThrd = pThrd;
conn->dstAddr = taosStrdup(addr); conn->dstAddr = taosStrdup(addr);
conn->ipStr = taosStrdup(ip); conn->ipStr = taosStrdup(ip);
conn->port = port; conn->port = port;
@ -1003,7 +1007,6 @@ static int32_t cliCreateConn(SCliThrd* pThrd, SCliConn** pCliConn, char* ip, int
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, &lino, _failed); TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, &lino, _failed);
} }
conn->hostThrd = pThrd;
conn->status = ConnNormal; conn->status = ConnNormal;
conn->broken = false; conn->broken = false;
QUEUE_INIT(&conn->q); QUEUE_INIT(&conn->q);