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

AsioTransportLayer::stopAcceptingSessions can deadlock if called before listener thread started listening

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.2.1, 7.3.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Fully Compatible
    • ALL
    • v7.2
    • Service Arch 2023-12-25
    • 105

      In the event that stopAcceptingSessions is invoked after the asio listener thread has started but before it has actually begun listening, stopAcceptingSessions will block forever while trying to join the listener thread. This is because the listener thread's state only transitions to kShuttingDown if its prior state was kActive, not also kNew.

      This situation is pretty rare. An example trigger would be killing a new mongos/d process very quickly after starting it up.

            Assignee:
            patrick.freed@mongodb.com Patrick Freed
            Reporter:
            patrick.freed@mongodb.com Patrick Freed
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: