summaryrefslogtreecommitdiff
path: root/src/mongo/s/mongos_main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/s/mongos_main.cpp')
-rw-r--r--src/mongo/s/mongos_main.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mongo/s/mongos_main.cpp b/src/mongo/s/mongos_main.cpp
index 4e8f3f329a9..8f0a4f7758b 100644
--- a/src/mongo/s/mongos_main.cpp
+++ b/src/mongo/s/mongos_main.cpp
@@ -366,6 +366,7 @@ void cleanupTask(const ShutdownTaskArgs& shutdownArgs) {
}
if (auto pool = Grid::get(opCtx)->getExecutorPool()) {
+ LOGV2_OPTIONS(7698300, {LogComponent::kSharding}, "Shutting down the ExecutorPool");
pool->shutdownAndJoin();
}
@@ -374,6 +375,13 @@ void cleanupTask(const ShutdownTaskArgs& shutdownArgs) {
}
if (Grid::get(serviceContext)->isShardingInitialized()) {
+ // The CatalogCache must be shuted down before shutting down the CatalogCacheLoader as
+ // the CatalogCache may try to schedule work on CatalogCacheLoader and fail.
+ LOGV2_OPTIONS(7698301, {LogComponent::kSharding}, "Shutting down the CatalogCache");
+ Grid::get(serviceContext)->catalogCache()->shutDownAndJoin();
+
+ LOGV2_OPTIONS(
+ 7698302, {LogComponent::kSharding}, "Shutting down the CatalogCacheLoader");
CatalogCacheLoader::get(serviceContext).shutDown();
}