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

Self-deadlock when cancelling networking sessions

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.4.0, 4.7.0
    • Component/s: Concurrency, Networking
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Sprint:
      Service arch 2020-04-20
    • Linked BF Score:
      32

      Description

      cancelSession erases the TransportSession under the Baton's mutex.  If that session has an outstanding Promise, however, it will try to break that promise, which in turn schedules the corresponding Future to run (and resolve with a BrokenPromise error).  But scheduling the Future to run requires locking the Baton's mutex.  This results in deadlock.

      Instead of destroying the TransportSession under the Baton's mutex, we should move the TransportSession out of the Baton's _sessions map under the mutex, the release the mutex before actually destroying the TransportSession.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              ben.caimano Benjamin Caimano (Inactive)
              Reporter:
              spencer Spencer Brody (Inactive)
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: