fix: add debug info

This commit is contained in:
yihaoDeng 2022-05-26 21:23:19 +08:00
parent e99cb305ff
commit ddbcaee1ff
3 changed files with 20 additions and 1 deletions

View File

@ -318,6 +318,7 @@ void transDQDestroy(SDelayQueue* queue);
int transDQSched(SDelayQueue* queue, void (*func)(void* arg), void* arg, uint64_t timeoutMs);
void transPrintEpSet(SEpSet* pEpSet);
/*
* init global func
*/

View File

@ -921,6 +921,8 @@ int cliAppCb(SCliConn* pConn, STransMsg* pResp, SCliMsg* pMsg) {
STransConnCtx* pCtx = pMsg->ctx;
SEpSet* pEpSet = &pCtx->epSet;
transPrintEpSet(pEpSet);
/*
* upper layer handle retry if code equal TSDB_CODE_RPC_NETWORK_UNAVAIL
*/
@ -972,8 +974,12 @@ int cliAppCb(SCliConn* pConn, STransMsg* pResp, SCliMsg* pMsg) {
pCtx->pRsp = NULL;
} else {
tTrace("%s cli conn %p handle resp", pTransInst->label, pConn);
if (pResp->code != 0) {
pTransInst->cfp(pTransInst->parent, pResp, NULL);
} else {
pTransInst->cfp(pTransInst->parent, pResp, pEpSet);
}
}
return 0;
}

View File

@ -446,4 +446,16 @@ int transDQSched(SDelayQueue* queue, void (*func)(void* arg), void* arg, uint64_
uv_timer_start(queue->timer, transDQTimeout, timeoutMs, 0);
return 0;
}
void transPrintEpSet(SEpSet* pEpSet) {
if (pEpSet == NULL) {
tTrace("NULL epset");
return;
}
tTrace("epset begin: inUse: %d", pEpSet->inUse);
for (int i = 0; i < pEpSet->numOfEps; i++) {
tTrace("ip: %s, port: %d", pEpSet->eps[i].fqdn, pEpSet->eps[i].port);
}
tTrace("epset end");
}
#endif