diff options
author | Antonio Fuschetto <antonio.fuschetto@mongodb.com> | 2023-05-15 13:30:45 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2023-05-15 15:25:49 +0000 |
commit | d97d54d03959846dd4294c811fe89fb91d7a9d89 (patch) | |
tree | 75d5cd1c582627760002453d1523befb8ed12516 | |
parent | 572a0c3987787a66f0192009b30651b8bae822ff (diff) | |
download | mongo-d97d54d03959846dd4294c811fe89fb91d7a9d89.tar.gz |
SERVER-76983 Shutdown and join the CatalogCached's thread pool when mongos terminates
-rw-r--r-- | src/mongo/s/mongos_main.cpp | 8 |
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(); } |