ratis icon indicating copy to clipboard operation
ratis copied to clipboard

RATIS-2174. Move future.join outside the lock

Open 133tosakarin opened this issue 4 months ago • 24 comments

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:

  1. RaftServerImpl.appendEntries
  2. RaftServerImpl.RequestVote
  3. checkAndInstallSnapshot

see https://issues.apache.org/jira/browse/RATIS-2174

133tosakarin avatar Oct 15 '24 12:10 133tosakarin