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

RouterStageMerge::kill() can crash during mongos shutdown

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 3.2.11, 3.4.0
    • Fix Version/s: 3.2.13, 3.4.2, 3.5.2
    • Component/s: Querying, Sharding
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Requested:
      v3.4, v3.2
    • Sprint:
      Query 2017-01-23

      Description

      RouterStageMerge::kill() retrieves an Event which will be signaled when the mongos cursor is safe to destroy. However, this Event will be invalid if it is retrieved while mongos is shutting down, as documented here:

      https://github.com/mongodb/mongo/blob/r3.5.1/src/mongo/s/query/async_results_merger.h#L170

      This case is not handled correctly by RouterStageMerge::kill(), since it can wait on an invalid event, resulting in an invariant being triggered. Fixing RouterStageMerge::kill() to not wait on an invalid event is a partial fix for SERVER-25497, which describes the more general problem of the mongos query path not being synchronized with the process's shutdown sequence.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: