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

filemd5 command fails to safely clean up PlanExecutor after manual yield

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.0.1, 4.1.1
    • Component/s: GridFS
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Requested:
      v4.0
    • Sprint:
      Query 2018-07-02
    • Linked BF Score:
      60

      Description

      The command creates a PlanExecutor here, and in order to destroy a PlanExecutor, a collection lock must be held in MODE_IS. If the command exits via an exception while yielded, this will not be true.

      For example, if this AutoGetCollectionForReadCommand throws an exception due to interrupt from a step-down, the PlanExecutor will be destroyed without holding a lock.

      While being destroyed, the PlanExecutor needs to communicate to the collection's cursor manager that it is being deleted, so doing so without a lock can lead to a race, as described in SERVER-25694.

        Attachments

          Activity

            People

            Assignee:
            charlie.swanson Charlie Swanson
            Reporter:
            charlie.swanson Charlie Swanson
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: