refactor retry

This commit is contained in:
yihaoDeng 2022-11-28 10:10:11 +08:00
parent 55af567ccc
commit f3c1eb829e
1 changed files with 16 additions and 11 deletions

View File

@ -1425,21 +1425,26 @@ bool cliResetEpset(STransConnCtx* pCtx, STransMsg* pResp, bool hasEpSet) {
} }
} }
} else { } else {
SEpSet epSet; SEpSet epSet;
// assert(pResp->contLen == sizeof(epSet));
int32_t valid = tDeserializeSEpSet(pResp->pCont, pResp->contLen, &epSet); int32_t valid = tDeserializeSEpSet(pResp->pCont, pResp->contLen, &epSet);
if (valid < 0) { if (valid < 0) {
// assert(0); tDebug("get invalid epset, epset equal, continue");
} if (pCtx->epsetRetryCnt >= pCtx->epSet.numOfEps) {
if (!transEpSetIsEqual(&pCtx->epSet, &epSet)) { noDelay = false;
tDebug("epset not equal, retry new epset"); } else {
pCtx->epSet = epSet; EPSET_FORWARD_INUSE(&pCtx->epSet);
noDelay = true;
}
} else { } else {
tDebug("epset equal, continue"); if (!transEpSetIsEqual(&pCtx->epSet, &epSet)) {
EPSET_FORWARD_INUSE(&pCtx->epSet); tDebug("epset not equal, retry new epset");
pCtx->epSet = epSet;
} else {
tDebug("epset equal, continue");
EPSET_FORWARD_INUSE(&pCtx->epSet);
}
noDelay = false;
} }
noDelay = false;
} }
return noDelay; return noDelay;
} }