summaryrefslogtreecommitdiff
path: root/src/mongo/db/service_context.cpp
diff options
context:
space:
mode:
authorPavi Vetriselvan <pvselvan@umich.edu>2020-04-13 17:24:16 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-04-15 18:39:52 +0000
commit9f01fb4c7560fa4937a0fada1b4517fff6cc33dc (patch)
tree452ca2a27c42beb4e2630711534b6f2ad6058073 /src/mongo/db/service_context.cpp
parent8c02eff37d78d7766223b05520683905c8e7dfc8 (diff)
downloadmongo-9f01fb4c7560fa4937a0fada1b4517fff6cc33dc.tar.gz
SERVER-46953 Log number of operations killed by shutdown
Diffstat (limited to 'src/mongo/db/service_context.cpp')
-rw-r--r--src/mongo/db/service_context.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mongo/db/service_context.cpp b/src/mongo/db/service_context.cpp
index b4eda7a9b3d..c124cf751f6 100644
--- a/src/mongo/db/service_context.cpp
+++ b/src/mongo/db/service_context.cpp
@@ -332,6 +332,7 @@ void ServiceContext::setKillAllOperations() {
// Ensure that all newly created operation contexts will immediately be in the interrupted state
_globalKill.store(true);
+ auto opsKilled = 0;
// Interrupt all active operations
for (auto&& client : _clients) {
@@ -339,9 +340,13 @@ void ServiceContext::setKillAllOperations() {
auto opCtxToKill = client->getOperationContext();
if (opCtxToKill) {
killOperation(lk, opCtxToKill, ErrorCodes::InterruptedAtShutdown);
+ opsKilled++;
}
}
+ // Shared by mongos and mongod shutdown code paths
+ LOGV2(4695300, "Interrupted all currently running operations", "opsKilled"_attr = opsKilled);
+
// Notify any listeners who need to reach to the server shutting down
for (const auto listener : _killOpListeners) {
try {