提交 f3c1eb82 编写于 作者: dengyihao's avatar dengyihao

refactor retry

上级 55af567c
...@@ -1426,12 +1426,16 @@ bool cliResetEpset(STransConnCtx* pCtx, STransMsg* pResp, bool hasEpSet) { ...@@ -1426,12 +1426,16 @@ 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) {
noDelay = false;
} else {
EPSET_FORWARD_INUSE(&pCtx->epSet);
noDelay = true;
} }
} else {
if (!transEpSetIsEqual(&pCtx->epSet, &epSet)) { if (!transEpSetIsEqual(&pCtx->epSet, &epSet)) {
tDebug("epset not equal, retry new epset"); tDebug("epset not equal, retry new epset");
pCtx->epSet = epSet; pCtx->epSet = epSet;
...@@ -1441,6 +1445,7 @@ bool cliResetEpset(STransConnCtx* pCtx, STransMsg* pResp, bool hasEpSet) { ...@@ -1441,6 +1445,7 @@ bool cliResetEpset(STransConnCtx* pCtx, STransMsg* pResp, bool hasEpSet) {
} }
noDelay = false; noDelay = false;
} }
}
return noDelay; return noDelay;
} }
bool cliGenRetryRule(SCliConn* pConn, STransMsg* pResp, SCliMsg* pMsg) { bool cliGenRetryRule(SCliConn* pConn, STransMsg* pResp, SCliMsg* pMsg) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册