fix: handle except
This commit is contained in:
parent
3b1664d9e4
commit
bfe5ab779b
|
@ -18,6 +18,10 @@
|
||||||
static int32_t transSCliInst = 0;
|
static int32_t transSCliInst = 0;
|
||||||
static int32_t refMgt = 0;
|
static int32_t refMgt = 0;
|
||||||
|
|
||||||
|
typedef struct SExHandleWrap {
|
||||||
|
void* exhandle;
|
||||||
|
int64_t refId;
|
||||||
|
} SExHandleWrap;
|
||||||
typedef struct SCliConn {
|
typedef struct SCliConn {
|
||||||
T_REF_DECLARE()
|
T_REF_DECLARE()
|
||||||
uv_connect_t connReq;
|
uv_connect_t connReq;
|
||||||
|
@ -338,9 +342,11 @@ void cliHandleResp(SCliConn* conn) {
|
||||||
exh->pThrd = pThrd;
|
exh->pThrd = pThrd;
|
||||||
exh->refId = transAddExHandle(refMgt, exh);
|
exh->refId = transAddExHandle(refMgt, exh);
|
||||||
|
|
||||||
transMsg.info.handle = exh;
|
SExHandleWrap* wrap = taosMemoryCalloc(1, sizeof(SExHandleWrap));
|
||||||
transMsg.info.refId = exh->refId;
|
wrap->exhandle = exh;
|
||||||
|
wrap->refId = exh->refId;
|
||||||
conn->refId = exh->refId;
|
conn->refId = exh->refId;
|
||||||
|
transMsg.info.handle = wrap;
|
||||||
tDebug("%s conn %p ref by app", CONN_GET_INST_LABEL(conn), conn);
|
tDebug("%s conn %p ref by app", CONN_GET_INST_LABEL(conn), conn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1007,6 +1013,8 @@ int cliAppCb(SCliConn* pConn, STransMsg* pResp, SCliMsg* pMsg) {
|
||||||
pMsg->sent = 0;
|
pMsg->sent = 0;
|
||||||
tTrace("try to send req to next node");
|
tTrace("try to send req to next node");
|
||||||
pMsg->st = taosGetTimestampUs();
|
pMsg->st = taosGetTimestampUs();
|
||||||
|
|
||||||
|
taosMemoryFree(pResp->info.handle);
|
||||||
pCtx->retryCount += 1;
|
pCtx->retryCount += 1;
|
||||||
if (pResp->code == TSDB_CODE_RPC_NETWORK_UNAVAIL) {
|
if (pResp->code == TSDB_CODE_RPC_NETWORK_UNAVAIL) {
|
||||||
if (pCtx->retryCount < pEpSet->numOfEps * 3) {
|
if (pCtx->retryCount < pEpSet->numOfEps * 3) {
|
||||||
|
|
Loading…
Reference in New Issue