Uploaded image for project: 'Ratis'
  1. Ratis
  2. RATIS-2174

Move future.join outside the lock

    XMLWordPrintableJSON

Details

    • Wish
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.1.1
    • 3.2.0
    • server
    • None

    Description

       
      In RATIS-2162, we solved a deadlock problem, but after observing for a few days, there may still be potential deadlock problems elsewhere.
       
      The main reason for deadlock is to hold a lock and wait for a future.
       
      So I suggest waiting for the future outside the lock as much as possible, which should avoid deadlocks
       

      Currently, I found that calling changeToFollower in the following functions causes the above situation:

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

      Attachments

        1. 1168_review.patch
          16 kB
          Tsz-wo Sze

        Issue Links

          Activity

            People

              tohsakarin__ yuuka
              tohsakarin__ yuuka
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 6h 50m
                  6h 50m