summaryrefslogtreecommitdiff
path: root/src/mongo/db/db.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/db.cpp')
-rw-r--r--src/mongo/db/db.cpp10
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()) {