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

Destroy sharding task executors and AsyncRequestSenders after the PeriodicRunner is destroyed in mongod shutdown

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.6.9, 4.0.4, 4.1.4
    • Affects Version/s: 3.6.8, 4.0.2, 4.1.3
    • Component/s: Sharding
    • Labels:
      None
    • Fully Compatible
    • ALL
    • v4.0, v3.6
    • Sharding 2018-10-08

      Problem Description

      Some tasks created to use the PeriodicRunner make use of sharding task executors and AsyncRequestSenders, such as the LogicalSessionCache refresh or reap threads.

      In shutdown on mongod, we destroy the Grid's task executors before we destroy the PeriodicRunner. This can lead to both attempted use of destroyed data, and shutdown exceptions when trying to call member functions on the task executors and AsyncRequestSenders.

      Proposed Fix

      The simple fix is to shut down the PeriodicRunner before shutting down Sharding-related machinery. We will place the call to shut down the PeriodicRunner here.

      This fix has been verified to fix errors in an Evergreen patch.

            Assignee:
            blake.oler@mongodb.com Blake Oler
            Reporter:
            blake.oler@mongodb.com Blake Oler
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: