Skip to content

Commit

Permalink
[ISSUES alibaba#8635] fix a NPE when call the shutdown method (alibab…
Browse files Browse the repository at this point in the history
…a#8636)

* [ISSUES alibaba#8635] fix a NPE when call the shutdown method

Close alibaba#8635

* [ISSUES alibaba#8635] remove init judgment
  • Loading branch information
onewe authored Jun 28, 2022
1 parent ccce9da commit 56ee220
Showing 1 changed file with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -469,10 +469,16 @@ public void shutdown() throws NacosException {
Loggers.RAFT.warn("start to close old raft protocol!!!");
Loggers.RAFT.warn("stop old raft protocol task for notifier");
NotifyCenter.deregisterSubscriber(notifier);
Loggers.RAFT.warn("stop old raft protocol task for master task");
masterTask.cancel(true);
Loggers.RAFT.warn("stop old raft protocol task for heartbeat task");
heartbeatTask.cancel(true);
if (masterTask != null) {
Loggers.RAFT.warn("stop old raft protocol task for master task");
masterTask.cancel(true);
}

if (heartbeatTask != null) {
Loggers.RAFT.warn("stop old raft protocol task for heartbeat task");
heartbeatTask.cancel(true);
}

Loggers.RAFT.warn("clean old cache datum for old raft");
datums.clear();
}
Expand Down

0 comments on commit 56ee220

Please sign in to comment.