diff options
author | Ben Caimano <ben.caimano@10gen.com> | 2019-05-14 16:38:25 -0400 |
---|---|---|
committer | Ben Caimano <ben.caimano@10gen.com> | 2019-05-15 16:47:41 -0400 |
commit | 307259e53d8bc276274bb4e88b82821b4c6d001c (patch) | |
tree | 690f6b77d2d0b4a98acc4580ca6023477f09bdbb /src/mongo/client | |
parent | bae6f255cb2c99d557f02d3861c4abb654fe3071 (diff) | |
download | mongo-307259e53d8bc276274bb4e88b82821b4c6d001c.tar.gz |
SERVER-41149 Skip ReplicaSetMonitor refresh on shutdown
Diffstat (limited to 'src/mongo/client')
-rw-r--r-- | src/mongo/client/replica_set_monitor.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mongo/client/replica_set_monitor.cpp b/src/mongo/client/replica_set_monitor.cpp index a1185cb519e..21b2e42b4ad 100644 --- a/src/mongo/client/replica_set_monitor.cpp +++ b/src/mongo/client/replica_set_monitor.cpp @@ -258,6 +258,11 @@ void ReplicaSetMonitor::_doScheduledRefresh(const CallbackHandle& currentHandle) SemiFuture<HostAndPort> ReplicaSetMonitor::getHostOrRefresh(const ReadPreferenceSetting& criteria, Milliseconds maxWait) { + // If we're in shutdown, don't bother + if (globalInShutdownDeprecated()) { + return Status(ErrorCodes::ShutdownInProgress, "Server is shutting down"_sd); + } + if (_isRemovedFromManager.load()) { return Status(ErrorCodes::ReplicaSetMonitorRemoved, str::stream() << "ReplicaSetMonitor for set " << getName() << " is removed"); |