diff options
author | Andy Schwerin <schwerin@mongodb.com> | 2017-01-15 15:43:06 -0500 |
---|---|---|
committer | Andy Schwerin <schwerin@mongodb.com> | 2017-01-15 15:44:49 -0500 |
commit | a7e74d56036e94c3e4ed11ceeb4cd43e95209aa5 (patch) | |
tree | e90d6b26cb5f1bb26ebf95a36aa93ddf60f8c45c /src/mongo/s | |
parent | be58d599fd9df085c94be3c22051f04aa3df5c13 (diff) | |
download | mongo-a7e74d56036e94c3e4ed11ceeb4cd43e95209aa5.tar.gz |
SERVER-27603 Rename mongo::inShutdown() to mongo::globalInShutdownDeprecated() for clarity.
Calling this function is deprecated because modules that consult it
cannot engage in an orderly, coordinated shutdown. Instead, such
modules tend to just stop working at some point after
mongo::shutdown() is invoked, without regard to whether modules that
depend on them have already shut down.
As such, for clarity, this patch renames the function from
mongo::inShutdown() to mongo::globalInShutdownDeprecated(). This also
helps disambiguate calls to this function from calls to individual
components' similarly named functions.
Also, remove uncalled mongo::inShutdownStrict().
Diffstat (limited to 'src/mongo/s')
-rw-r--r-- | src/mongo/s/client/shard_connection.cpp | 2 | ||||
-rw-r--r-- | src/mongo/s/query/cluster_cursor_cleanup_job.cpp | 2 | ||||
-rw-r--r-- | src/mongo/s/server.cpp | 2 | ||||
-rw-r--r-- | src/mongo/s/sharding_initialization.cpp | 2 | ||||
-rw-r--r-- | src/mongo/s/sharding_uptime_reporter.cpp | 2 |
5 files changed, 5 insertions, 5 deletions
diff --git a/src/mongo/s/client/shard_connection.cpp b/src/mongo/s/client/shard_connection.cpp index 490a2f4ee83..ec80fb5c5e5 100644 --- a/src/mongo/s/client/shard_connection.cpp +++ b/src/mongo/s/client/shard_connection.cpp @@ -181,7 +181,7 @@ public: if (ss->avail) { // If we're shutting down, don't want to initiate release mechanism as it is // slow, and isn't needed since all connections will be closed anyway. - if (inShutdown()) { + if (globalInShutdownDeprecated()) { if (versionManager.isVersionableCB(ss->avail)) { versionManager.resetShardVersionCB(ss->avail); } diff --git a/src/mongo/s/query/cluster_cursor_cleanup_job.cpp b/src/mongo/s/query/cluster_cursor_cleanup_job.cpp index 73de6b071f6..45fe1c44825 100644 --- a/src/mongo/s/query/cluster_cursor_cleanup_job.cpp +++ b/src/mongo/s/query/cluster_cursor_cleanup_job.cpp @@ -66,7 +66,7 @@ void ClusterCursorCleanupJob::run() { ClusterCursorManager* manager = grid.getCursorManager(); invariant(manager); - while (!inShutdown()) { + while (!globalInShutdownDeprecated()) { manager->killMortalCursorsInactiveSince(Date_t::now() - Milliseconds(cursorTimeoutMillis.load())); manager->incrementCursorsTimedOut(manager->reapZombieCursors()); diff --git a/src/mongo/s/server.cpp b/src/mongo/s/server.cpp index e80e9591497..d18e62048e8 100644 --- a/src/mongo/s/server.cpp +++ b/src/mongo/s/server.cpp @@ -271,7 +271,7 @@ static ExitCode runMongosServer() { Status status = initializeSharding(opCtx.get()); if (!status.isOK()) { if (status == ErrorCodes::CallbackCanceled) { - invariant(inShutdown()); + invariant(globalInShutdownDeprecated()); log() << "Shutdown called before mongos finished starting up"; return EXIT_CLEAN; } diff --git a/src/mongo/s/sharding_initialization.cpp b/src/mongo/s/sharding_initialization.cpp index 5bcce059ec4..a98d9b0941f 100644 --- a/src/mongo/s/sharding_initialization.cpp +++ b/src/mongo/s/sharding_initialization.cpp @@ -233,7 +233,7 @@ Status reloadShardRegistryUntilSuccess(OperationContext* txn) { return Status::OK(); } - while (!inShutdown()) { + while (!globalInShutdownDeprecated()) { auto stopStatus = txn->checkForInterruptNoAssert(); if (!stopStatus.isOK()) { return stopStatus; diff --git a/src/mongo/s/sharding_uptime_reporter.cpp b/src/mongo/s/sharding_uptime_reporter.cpp index ba5f3690822..d2d170df176 100644 --- a/src/mongo/s/sharding_uptime_reporter.cpp +++ b/src/mongo/s/sharding_uptime_reporter.cpp @@ -97,7 +97,7 @@ void ShardingUptimeReporter::startPeriodicThread() { const std::string instanceId(constructInstanceIdString()); const Timer upTimeTimer; - while (!inShutdown()) { + while (!globalInShutdownDeprecated()) { { auto txn = cc().makeOperationContext(); reportStatus(txn.get(), instanceId, upTimeTimer); |