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

ReplicationCoordinatorExternalStateImpl::shutdown() must not hold _threadMutex while waiting for _taskExecutor

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.6.10, 4.0.5, 4.1.5
    • Affects Version/s: 3.6.8, 4.0.3, 4.1.3
    • Component/s: Replication, Storage
    • None
    • Fully Compatible
    • ALL
    • v4.0, v3.6
    • Repl 2018-09-24, Repl 2018-10-22, Repl 2018-11-05
    • 65

      ReplicationCoordinatorExternalStateImpl::shutdown() holds _threadMutex while waiting for _taskExecutor. This is problematic, since the _taskExecutor's function takes database locks, so we can wait for database locks while holding _threadMutex. This can lead to deadlock, since we can wait for _threadMutex while holding ReplicationCoordinatorImpl::_mutex, and we can wait for ReplicationCoordinatorImpl::_mutex while holding database locks.

            Assignee:
            tess.avitabile@mongodb.com Tess Avitabile (Inactive)
            Reporter:
            tess.avitabile@mongodb.com Tess Avitabile (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: