summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSpencer T Brody <spencer@mongodb.com>2015-10-22 17:37:02 -0400
committerSpencer T Brody <spencer@mongodb.com>2015-10-23 11:19:45 -0400
commitf0507f5b5b22b5b6a1de50ea4f6e021b394418ad (patch)
tree05ec80fc1c2aeb6468cde05d65d651458eaf47dd
parentee5763eee2b7a7b8369ccf2f90d9e2e06d36fb31 (diff)
downloadmongo-f0507f5b5b22b5b6a1de50ea4f6e021b394418ad.tar.gz
SERVER-21075 Don't segfault mongos at shutdown if it never finished initializing sharding
-rw-r--r--src/mongo/s/server.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/mongo/s/server.cpp b/src/mongo/s/server.cpp
index 02a6a6f6857..7facf5e8477 100644
--- a/src/mongo/s/server.cpp
+++ b/src/mongo/s/server.cpp
@@ -438,11 +438,12 @@ void mongo::exitCleanly(ExitCode code) {
}
auto catalogMgr = grid.catalogManager(txn);
- catalogMgr->shutDown(txn);
-
- auto cursorManager = grid.getCursorManager();
- cursorManager->killAllCursors();
- cursorManager->reapZombieCursors();
+ if (catalogMgr) {
+ catalogMgr->shutDown(txn);
+ auto cursorManager = grid.getCursorManager();
+ cursorManager->killAllCursors();
+ cursorManager->reapZombieCursors();
+ }
}
mongo::dbexit(code);