diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/mongo/db/db.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mongo/db/db.cpp b/src/mongo/db/db.cpp index ded1573b0aa..867352fb200 100644 --- a/src/mongo/db/db.cpp +++ b/src/mongo/db/db.cpp @@ -878,6 +878,11 @@ void shutdownTask() { // Shut down the global dbclient pool so callers stop waiting for connections. globalConnPool.shutdown(); + // Shut down the background periodic task runner + if (auto runner = serviceContext->getPeriodicRunner()) { + runner->shutdown(); + } + if (serviceContext->getStorageEngine()) { ServiceContext::UniqueOperationContext uniqueOpCtx; OperationContext* opCtx = client->getOperationContext(); @@ -898,11 +903,6 @@ void shutdownTask() { serviceContext->setKillAllOperations(); - // Shut down the background periodic task runner - if (auto runner = serviceContext->getPeriodicRunner()) { - runner->shutdown(); - } - ReplicaSetMonitor::shutdown(); if (auto sr = Grid::get(serviceContext)->shardRegistry()) { |