fix: reset sync timer although failed to enqueue since Out of Memory in rpc queue

This commit is contained in:
Benguang Zhao 2024-01-31 18:28:51 +08:00
parent 8cae539fce
commit 57714dff65
1 changed files with 6 additions and 4 deletions

View File

@ -2141,7 +2141,7 @@ static void syncNodeEqPingTimer(void* param, void* tmrId) {
if (code != 0) { if (code != 0) {
sError("failed to build ping msg"); sError("failed to build ping msg");
rpcFreeCont(rpcMsg.pCont); rpcFreeCont(rpcMsg.pCont);
return; goto _out;
} }
// sTrace("enqueue ping msg"); // sTrace("enqueue ping msg");
@ -2149,9 +2149,10 @@ static void syncNodeEqPingTimer(void* param, void* tmrId) {
if (code != 0) { if (code != 0) {
sError("failed to sync enqueue ping msg since %s", terrstr()); sError("failed to sync enqueue ping msg since %s", terrstr());
rpcFreeCont(rpcMsg.pCont); rpcFreeCont(rpcMsg.pCont);
return; goto _out;
} }
_out:
taosTmrReset(syncNodeEqPingTimer, pNode->pingTimerMS, pNode, syncEnv()->pTimerManager, &pNode->pPingTimer); taosTmrReset(syncNodeEqPingTimer, pNode->pingTimerMS, pNode, syncEnv()->pTimerManager, &pNode->pPingTimer);
} }
} }
@ -2211,7 +2212,7 @@ static void syncNodeEqHeartbeatTimer(void* param, void* tmrId) {
if (code != 0) { if (code != 0) {
sError("failed to build heartbeat msg"); sError("failed to build heartbeat msg");
return; goto _out;
} }
sTrace("vgId:%d, enqueue heartbeat timer", pNode->vgId); sTrace("vgId:%d, enqueue heartbeat timer", pNode->vgId);
@ -2219,9 +2220,10 @@ static void syncNodeEqHeartbeatTimer(void* param, void* tmrId) {
if (code != 0) { if (code != 0) {
sError("failed to enqueue heartbeat msg since %s", terrstr()); sError("failed to enqueue heartbeat msg since %s", terrstr());
rpcFreeCont(rpcMsg.pCont); rpcFreeCont(rpcMsg.pCont);
return; goto _out;
} }
_out:
taosTmrReset(syncNodeEqHeartbeatTimer, pNode->heartbeatTimerMS, pNode, syncEnv()->pTimerManager, taosTmrReset(syncNodeEqHeartbeatTimer, pNode->heartbeatTimerMS, pNode, syncEnv()->pTimerManager,
&pNode->pHeartbeatTimer); &pNode->pHeartbeatTimer);