Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.4.0
    • Fix Version/s: 3.5.0
    • Component/s: server
    • Labels:
      None

      Description

      In Leader.java, getEpochToPropose() and waitForEpochAck() have the following code:

      if (readyToStart && verifier.containsQuorum(electingFollowers)) {
      electionFinished = true;
      electingFollowers.notifyAll();
      } else {
      electingFollowers.wait(self.getInitLimit()*self.getTickTime());
      if (waitingForNewEpoch)

      { throw new InterruptedException("Out of time to propose an epoch"); }

      }

      In Java, the wait statement can wake up without being notified, interrupted, or timing out, a so-called spurious wakeup. So it should be guarded by a while loop with the condition we're waiting for.

        Attachments

        1. zookeeper-1191-ver1.patch
          2 kB
          Alexander Shraer
        2. zookeeper-1191.patch
          1 kB
          Alexander Shraer

          Activity

            People

            • Assignee:
              shralex Alexander Shraer
              Reporter:
              shralex Alexander Shraer
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: