summaryrefslogtreecommitdiff
path: root/src/mongo/s
diff options
context:
space:
mode:
authorJason Carey <jcarey@argv.me>2019-02-27 13:40:18 -0500
committerJason Carey <jcarey@argv.me>2019-03-05 10:05:45 -0500
commit32a067938731d184b271ba3d7f43ca6727e3109c (patch)
tree759f22c263da841521a1653701a94e4b7c05c8f0 /src/mongo/s
parent602bfb9c52b2274d55492f73eeac8513d9048d10 (diff)
downloadmongo-32a067938731d184b271ba3d7f43ca6727e3109c.tar.gz
SERVER-39427 Modify interrupt semantics for opCtx
* rename opCtx->runWithoutInterruption to runWithoutInterruptionExceptAtGlobalShutdown * add a opCtx->setIsExecutingShutdown method which makes the op immune to all forms of interruption, including global shutdown This clarifies what opCtx->runWithoutInterruption actually did and offers an escape hatch that turns off interruption at process exit for the thread doing cleanup.
Diffstat (limited to 'src/mongo/s')
-rw-r--r--src/mongo/s/async_requests_sender.cpp4
-rw-r--r--src/mongo/s/server.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/mongo/s/async_requests_sender.cpp b/src/mongo/s/async_requests_sender.cpp
index 03cb8ad6d54..6296a1254f9 100644
--- a/src/mongo/s/async_requests_sender.cpp
+++ b/src/mongo/s/async_requests_sender.cpp
@@ -88,8 +88,6 @@ AsyncRequestsSender::~AsyncRequestsSender() {
} catch (const ExceptionFor<ErrorCodes::InterruptedAtShutdown>&) {
// Ignore interrupted at shutdown. No need to cleanup if we're going into process-wide
// shutdown.
- //
- // TODO: Figure out how to do actual NonInterruptibility in SERVER-39427
}
}
@@ -112,7 +110,7 @@ AsyncRequestsSender::Response AsyncRequestsSender::next() {
continue;
}
} else {
- _opCtx->runWithoutInterruption([&] { _makeProgress(); });
+ _opCtx->runWithoutInterruptionExceptAtGlobalShutdown([&] { _makeProgress(); });
}
}
return *readyResponse;
diff --git a/src/mongo/s/server.cpp b/src/mongo/s/server.cpp
index 8f6de4c64ed..acf643ad1c7 100644
--- a/src/mongo/s/server.cpp
+++ b/src/mongo/s/server.cpp
@@ -199,6 +199,8 @@ void cleanupTask(ServiceContext* serviceContext) {
opCtx = uniqueTxn.get();
}
+ opCtx->setIsExecutingShutdown();
+
if (serviceContext) {
serviceContext->setKillAllOperations();