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

Race between SharedStateImpl::addChild and transitionToFinished

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.2.0-rc5, 4.3.1
    • Affects Version/s: None
    • Component/s: Internal Code
    • None
    • Fully Compatible
    • ALL
    • v4.2
    • Service Arch 2019-08-12
    • 10

      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  

            Assignee:
            mira.carey@mongodb.com Mira Carey
            Reporter:
            mira.carey@mongodb.com Mira Carey
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: