Uploaded image for project: 'Bookkeeper'
  1. Bookkeeper
  2. BOOKKEEPER-924

addEntry() is susceptible to spurious wakeups

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 4.3.2
    • Fix Version/s: 4.5.0
    • Component/s: None
    • Labels:
      None

      Description

      LedgerHandle sync interface heavily depends on SyncCounter to convert async interfaces
      into sync interfaces.

      Usaylly

      SyncCounter.inc()
      asyncCall()
      SyncCOunter.block(0)

      The block code is.

      synchronized void block(int limit) throws InterruptedException {
      while (i > limit) {
      int prev = i;
      wait();
      if (i == prev)

      { break; }

      }
      }

      Since 'i' is going to be same as 'prev' on spurious wakeup, and wait() can return on spurious wakeups.

        Attachments

          Activity

            People

            • Assignee:
              eolivelli Enrico Olivelli
              Reporter:
              jujjuri JV Jujjuri
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Due:
                Created:
                Updated:
                Resolved: