Don't start listening for connections if already shutting down

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Major - P3
    • 9.0.0-rc0, 8.3.3
    • Affects Version/s: None
    • Component/s: None
    • None
    • Networking & Observability
    • Fully Compatible
    • v8.3
    • N&O 2026-04-13, N&O 2026-04-27
    • 0
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      If shutdown starts (e.g. `AsioTransportLayer::stopAcceptingSessions`) before `_runListener` initially acquires the lock, the server would deadlock because `_runListener` would change the listener state from `kShuttingDown` to `kActive` after `_startListening` returned, so would never get out of the while loop, and `stopAcceptingSessions` would be stuck when it attempts to join the listener thread. Not switching the state to `kActive` if it is already `kShuttingDown` fixes the issue. There's no race condition here since the state is guarded by `_mutex`.

            Assignee:
            Michael Nugent
            Reporter:
            Michael Nugent
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: