fix(sync): fix AddressSanitizer error

This commit is contained in:
Minghao Li 2022-11-09 17:33:22 +08:00
parent 2391391621
commit fcc50467f4
1 changed files with 9 additions and 0 deletions

View File

@ -1040,6 +1040,7 @@ void syncNodeClose(SSyncNode* pSyncNode) {
ret = raftStoreClose(pSyncNode->pRaftStore);
ASSERT(ret == 0);
pSyncNode->pRaftStore = NULL;
syncRespMgrDestroy(pSyncNode->pSyncRespMgr);
pSyncNode->pSyncRespMgr = NULL;
@ -2174,10 +2175,18 @@ static void syncNodeEqPeerHeartbeatTimer(void* param, void* tmrId) {
SSyncNode* pSyncNode = pData->pSyncNode;
SSyncTimer* pSyncTimer = pData->pTimer;
if (pSyncNode == NULL) {
return;
}
if (pSyncNode->state != TAOS_SYNC_STATE_LEADER) {
return;
}
if (pSyncNode->pRaftStore == NULL) {
return;
}
// sNTrace(pSyncNode, "eq peer hb timer");
int64_t timerLogicClock = atomic_load_64(&pSyncTimer->logicClock);