You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, @wenweihu86 , I think there's an issue in Code Snippet 1 because configuration.getServersList also includes the node itself. If peerMap.get(server.getServerId()) refers to the node itself, the return value will be null, and calling appendEntries(null) will trigger a null pointer exception(see Code Snippet 2peer.getNextIndex()).
Hi, @wenweihu86 , I think there's an issue in
Code Snippet 1
becauseconfiguration.getServersList
also includes the node itself. IfpeerMap.get(server.getServerId())
refers to the node itself, the return value will be null, and calling appendEntries(null) will trigger a null pointer exception(seeCode Snippet 2
peer.getNextIndex()
).raft-java/raft-java-core/src/main/java/com/github/wenweihu86/raft/RaftNode.java
Lines 161 to 169 in 50761c6
Code Snippet 1. Replicate method.
raft-java/raft-java-core/src/main/java/com/github/wenweihu86/raft/RaftNode.java
Lines 203 to 207 in 50761c6
Code Snippet 2. AppendEntries method.
Suggested fix:
I'm looking forward to your confirmation, and would be happy to help fix the issue if needed.
The text was updated successfully, but these errors were encountered: