Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-62682

PrimaryOnlyService Does Not Call _rebuildCV.notify_all() leading to calls to waitForConditionOrInterrupt not being triggered

    • Fully Compatible
    • ALL
    • v5.2, v5.0
    • Hide

      Te test included in the PR 'LookUpInstanceHangsForever' reproduces the issue.

      Show
      Te test included in the PR 'LookUpInstanceHangsForever' reproduces the issue.
    • Sharding 2022-01-24, Sharding 2022-02-07
    • 35
    • 2

      Since PrimaryOnlyService does not adhere to the contract of notifying the users of the condition variable whenever the underlying _state variable changes, its possible for its users such as lookUpInstance to end up waiting forever on the condition or interrupt

      For instance on step down, the function updates the _state to kPaused but does not notify the condition variable

      Adding a _rebuildCV.notify_all() after every update to _state should fix this issue.

            Assignee:
            luis.osta@mongodb.com Luis Osta (Inactive)
            Reporter:
            luis.osta@mongodb.com Luis Osta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: