fix: add retry
This commit is contained in:
parent
f5e3b409ab
commit
e99cb305ff
|
@ -926,11 +926,11 @@ int cliAppCb(SCliConn* pConn, STransMsg* pResp, SCliMsg* pMsg) {
|
||||||
*/
|
*/
|
||||||
tmsg_t msgType = pCtx->msgType;
|
tmsg_t msgType = pCtx->msgType;
|
||||||
if ((pTransInst->retry != NULL && (pTransInst->retry(pResp->code))) ||
|
if ((pTransInst->retry != NULL && (pTransInst->retry(pResp->code))) ||
|
||||||
((pResp->code == TSDB_CODE_RPC_NETWORK_UNAVAIL) && msgType == TDMT_MND_CONNECT)) {
|
(pResp->code == TSDB_CODE_RPC_NETWORK_UNAVAIL)) {
|
||||||
pMsg->sent = 0;
|
pMsg->sent = 0;
|
||||||
pMsg->st = taosGetTimestampUs();
|
pMsg->st = taosGetTimestampUs();
|
||||||
pCtx->retryCount += 1;
|
pCtx->retryCount += 1;
|
||||||
if (msgType == TDMT_MND_CONNECT && pResp->code == TSDB_CODE_RPC_NETWORK_UNAVAIL) {
|
if (pResp->code == TSDB_CODE_RPC_NETWORK_UNAVAIL) {
|
||||||
if (pCtx->retryCount < pEpSet->numOfEps) {
|
if (pCtx->retryCount < pEpSet->numOfEps) {
|
||||||
pEpSet->inUse = (++pEpSet->inUse) % pEpSet->numOfEps;
|
pEpSet->inUse = (++pEpSet->inUse) % pEpSet->numOfEps;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue