From 7968dbb00836210f4ccfb0e8395adc93453230ae Mon Sep 17 00:00:00 2001 From: satjd Date: Tue, 5 Nov 2019 17:54:55 +0800 Subject: [PATCH] make RequestVote RPC handler thread-safe --- .../nacos/naming/consistency/persistent/raft/RaftCore.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/naming/src/main/java/com/alibaba/nacos/naming/consistency/persistent/raft/RaftCore.java b/naming/src/main/java/com/alibaba/nacos/naming/consistency/persistent/raft/RaftCore.java index b0df814bb..0bb6fe74b 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/consistency/persistent/raft/RaftCore.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/consistency/persistent/raft/RaftCore.java @@ -426,7 +426,7 @@ public class RaftCore { } } - public RaftPeer receivedVote(RaftPeer remote) { + public synchronized RaftPeer receivedVote(RaftPeer remote) { if (!peers.contains(remote)) { throw new IllegalStateException("can not find peer: " + remote.ip); }