summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Carey <jcarey@argv.me>2018-04-30 14:01:43 -0400
committerJason Carey <jcarey@argv.me>2018-04-30 15:18:44 -0400
commit71ac74d57ea94bc78cf5f0e432c13e77ea788389 (patch)
tree5a141d087abb466f26d2896a7ac9a6e3f6e04323
parentb786f13ab28e275bffded1302b21bfd88977150d (diff)
downloadmongo-71ac74d57ea94bc78cf5f0e432c13e77ea788389.tar.gz
SERVER-34753 ARS::_makeProgress uses passed opCtx
The AsyncRequestsSender::_makeProgress method must use the passed opCtx to check for interruption.  Using _opCtx will cause it to throw out of cleanup
-rw-r--r--src/mongo/s/async_requests_sender.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mongo/s/async_requests_sender.cpp b/src/mongo/s/async_requests_sender.cpp
index d63429ff8e9..e1695673180 100644
--- a/src/mongo/s/async_requests_sender.cpp
+++ b/src/mongo/s/async_requests_sender.cpp
@@ -260,7 +260,10 @@ Status AsyncRequestsSender::_scheduleRequest(size_t remoteIndex) {
return Status::OK();
}
+// Passing opCtx means you'd like to opt into opCtx interruption. During cleanup we actually don't.
void AsyncRequestsSender::_makeProgress(OperationContext* opCtx) {
+ invariant(!opCtx || opCtx == _opCtx);
+
boost::optional<Job> job;
if (_baton) {
@@ -268,11 +271,11 @@ void AsyncRequestsSender::_makeProgress(OperationContext* opCtx) {
if (boost::optional<boost::optional<Job>> tryJob = _responseQueue.tryPop()) {
job = std::move(*tryJob);
} else {
- _baton->run(_opCtx, boost::none);
+ _baton->run(opCtx, boost::none);
}
} else {
// Otherwise we block on the queue
- job = _opCtx ? _responseQueue.pop(_opCtx) : _responseQueue.pop();
+ job = opCtx ? _responseQueue.pop(opCtx) : _responseQueue.pop();
}
if (!job) {