summaryrefslogtreecommitdiff
path: root/src/mongo/client/fetcher.cpp
diff options
context:
space:
mode:
authorScott Hernandez <scotthernandez@gmail.com>2016-07-08 17:14:44 -0400
committerScott Hernandez <scotthernandez@gmail.com>2016-07-11 10:44:20 -0400
commit00d3b20bf51315a1bda183fcad7b4737da789a48 (patch)
tree65f45721f571bff62c1a3a68cc622b3b35fd0a9f /src/mongo/client/fetcher.cpp
parentbcafb88541f91de118c5c5981c7040422c0694ea (diff)
downloadmongo-00d3b20bf51315a1bda183fcad7b4737da789a48.tar.gz
SERVER-23750: wait outside of the DataReplicator mutex
Diffstat (limited to 'src/mongo/client/fetcher.cpp')
-rw-r--r--src/mongo/client/fetcher.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mongo/client/fetcher.cpp b/src/mongo/client/fetcher.cpp
index b042a6dc0e9..4f6e831a501 100644
--- a/src/mongo/client/fetcher.cpp
+++ b/src/mongo/client/fetcher.cpp
@@ -255,6 +255,7 @@ void Fetcher::cancel() {
}
handle = _getMoreCallbackHandle;
+ _inShutdown = true;
}
_executor->cancel(handle);
@@ -288,6 +289,17 @@ void Fetcher::_callback(const RemoteCommandCallbackArgs& rcbd, const char* batch
return;
}
+ bool inShutdown = false;
+ {
+ stdx::lock_guard<stdx::mutex> lk(_mutex);
+ inShutdown = _inShutdown;
+ }
+ if (inShutdown) {
+ _work(Status(ErrorCodes::ShutdownInProgress, "fetcher shutting down"), nullptr, nullptr);
+ _finishCallback();
+ return;
+ }
+
const BSONObj& queryResponseObj = rcbd.response.getValue().data;
Status status = getStatusFromCommandResult(queryResponseObj);
if (!status.isOK()) {