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

Fix deadlock in FCBIS _cloneFiles

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Critical - P2 Critical - P2
    • 5.3.0, 5.2.0-rc6
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • ALL
    • v5.2
    • Replication 2022-01-24
    • 46

      Issue:
      In FileCopyBasedInitialSyncer::_cloneFiles, we can have a deadlock while acquiring FileCopyBasedInitialSyncer::_mutex between the main asyncTry and the return future.

      I assume that can happen if the startClonerFuture is ready before we hit the return statement.

      Proposed fix:

      The lock in the main asyncTry needs to be scoped to include only state's changing lines and not to include the return statement.

       

      Needed for better debugging:

      Can we add also a log line in the begging of FileCopyBasedInitialSyncer::_cloneFiles to output the number of files in filesToClone

            Assignee:
            m.maher@mongodb.com Moustafa Maher
            Reporter:
            m.maher@mongodb.com Moustafa Maher
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: