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

Race between SharedStateImpl::addChild and transitionToFinished

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.2.0-rc5, 4.3.1
    • Component/s: Internal Code
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Requested:
      v4.2
    • Sprint:
      Service Arch 2019-08-12
    • Linked BF Score:
      10

      Description

      There's an unfortunate race between addChild and transitionToFinished, where the caller of addChild can observe a kInit shared state, as can transitionToFinished, and then the caller of addChild can add a child that is never fulfilled by the caller of transitionToFinished.

      It looks like:

      addChild() transitionToFinished()
      loadState, observe init  
      acquire mutex  
      loadState, observe init  
        transition to finished, observed init
      attempt to cas to waitingOrHaveChildren  
        return, doing nothing
      add to children  
      strand the child in a way that won't be finished later  

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: