From 1578ea98998e33d06cc1776f2bbd86d626370124 Mon Sep 17 00:00:00 2001 From: Antonio Fuschetto Date: Mon, 15 May 2023 06:38:47 +0000 Subject: SERVER-77074 Always shutdown and join the CatalogCached's thread pool when mongod terminates --- src/mongo/db/mongod_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mongo/db/mongod_main.cpp b/src/mongo/db/mongod_main.cpp index 01b9fef468e..589ad967da8 100644 --- a/src/mongo/db/mongod_main.cpp +++ b/src/mongo/db/mongod_main.cpp @@ -1588,7 +1588,7 @@ void shutdownTask(const ShutdownTaskArgs& shutdownArgs) { migrationUtilExecutor->shutdown(); migrationUtilExecutor->join(); - if (ShardingState::get(serviceContext)->enabled()) { + 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(6773201, {LogComponent::kSharding}, "Shutting down the CatalogCache"); -- cgit v1.2.1