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

ServerDiscoveryMonitor::shutdown can lead to deadlock

    XMLWordPrintable

    Details

    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Sprint:
      Service arch 2020-12-28
    • Linked BF Score:
      38

      Description

      In a callback for TaskExecutor::scheduleRemoteCommand here, we try to acquire a mutex.
      This is a problem because in ServerDiscoveryMonitor::shutdown, we acquire the mutex before canceling the remaining tasks in the executor and shutting down the executor, and either cancellation or shutdown+join can cause the callbacks to run, leading to a deadlock.

      We should either reset the executor pointer and cancel the handles outside of the lock, or check the status passed into the callback for scheduleRemoteCommand and only acquire the mutex if it's an OK status.

        Attachments

          Activity

            People

            Assignee:
            matthew.saltz Matthew Saltz
            Reporter:
            matthew.saltz Matthew Saltz
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: