ratis
ratis copied to clipboard
RATIS-2174. Move future.join outside the lock
What changes were proposed in this pull request?
In recent observations, I found that some functions wait for a future while holding a lock, which is a very dangerous thing. To avoid the deadlock problem caused by holding the lock and waiting for the future, I am considering moving the future waiting outside the lock.
Currently, I found that calling changeToFollower in the following functions causes the above situation:
- RaftServerImpl.appendEntries
- RaftServerImpl.RequestVote
- checkAndInstallSnapshot
see https://issues.apache.org/jira/browse/RATIS-2174