fix: add debug info
This commit is contained in:
parent
e99cb305ff
commit
ddbcaee1ff
|
@ -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
|
||||
*/
|
||||
|
|
|
@ -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,7 +974,11 @@ int cliAppCb(SCliConn* pConn, STransMsg* pResp, SCliMsg* pMsg) {
|
|||
pCtx->pRsp = NULL;
|
||||
} else {
|
||||
tTrace("%s cli conn %p handle resp", pTransInst->label, pConn);
|
||||
pTransInst->cfp(pTransInst->parent, pResp, pEpSet);
|
||||
if (pResp->code != 0) {
|
||||
pTransInst->cfp(pTransInst->parent, pResp, NULL);
|
||||
} else {
|
||||
pTransInst->cfp(pTransInst->parent, pResp, pEpSet);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue