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

    XMLWordPrintable

Details

    • 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

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: