make RequestVote RPC handler thread-safe

This commit is contained in:
satjd 2019-11-05 17:54:55 +08:00
parent 1054a9916e
commit 7968dbb008

View File

@ -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);
}