From 57714dff65720c8533acbb8fa3f683f20bbf79ec Mon Sep 17 00:00:00 2001 From: Benguang Zhao Date: Wed, 31 Jan 2024 18:28:51 +0800 Subject: [PATCH] fix: reset sync timer although failed to enqueue since Out of Memory in rpc queue --- source/libs/sync/src/syncMain.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/source/libs/sync/src/syncMain.c b/source/libs/sync/src/syncMain.c index edaf59f9db..c0808a95cc 100644 --- a/source/libs/sync/src/syncMain.c +++ b/source/libs/sync/src/syncMain.c @@ -2141,7 +2141,7 @@ static void syncNodeEqPingTimer(void* param, void* tmrId) { if (code != 0) { sError("failed to build ping msg"); rpcFreeCont(rpcMsg.pCont); - return; + goto _out; } // sTrace("enqueue ping msg"); @@ -2149,9 +2149,10 @@ static void syncNodeEqPingTimer(void* param, void* tmrId) { if (code != 0) { sError("failed to sync enqueue ping msg since %s", terrstr()); rpcFreeCont(rpcMsg.pCont); - return; + goto _out; } + _out: taosTmrReset(syncNodeEqPingTimer, pNode->pingTimerMS, pNode, syncEnv()->pTimerManager, &pNode->pPingTimer); } } @@ -2211,7 +2212,7 @@ static void syncNodeEqHeartbeatTimer(void* param, void* tmrId) { if (code != 0) { sError("failed to build heartbeat msg"); - return; + goto _out; } sTrace("vgId:%d, enqueue heartbeat timer", pNode->vgId); @@ -2219,9 +2220,10 @@ static void syncNodeEqHeartbeatTimer(void* param, void* tmrId) { if (code != 0) { sError("failed to enqueue heartbeat msg since %s", terrstr()); rpcFreeCont(rpcMsg.pCont); - return; + goto _out; } + _out: taosTmrReset(syncNodeEqHeartbeatTimer, pNode->heartbeatTimerMS, pNode, syncEnv()->pTimerManager, &pNode->pHeartbeatTimer);