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

filemd5 command fails to safely clean up PlanExecutor after manual yield

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.0.1, 4.1.1
    • Affects Version/s: None
    • Component/s: GridFS
    • None
    • Fully Compatible
    • ALL
    • v4.0
    • Query 2018-07-02
    • 60

      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.

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

              Created:
              Updated:
              Resolved: