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

Self-deadlock when cancelling networking sessions

    • Fully Compatible
    • ALL
    • Service arch 2020-04-20
    • 32

      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.

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

              Created:
              Updated:
              Resolved: