Details

    • Sub-task
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 3.4.0
    • 3.5.0
    • server
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: