summaryrefslogtreecommitdiff
path: root/src/mongo/db/introspect.cpp
diff options
context:
space:
mode:
authorJustin Seyster <justin.seyster@mongodb.com>2018-03-30 15:25:47 -0400
committerJustin Seyster <justin.seyster@mongodb.com>2018-04-18 16:41:30 -0400
commitd9a5a306690d7cdb8831e64441a66cdd503d8064 (patch)
tree9d28b12e88351a4efab5b9d883f9a79ac2b2044a /src/mongo/db/introspect.cpp
parentcf34f10d361240f4a94f5fae94cb55bc2c0acf9b (diff)
downloadmongo-d9a5a306690d7cdb8831e64441a66cdd503d8064.tar.gz
SERVER-27534 All writing operations must fail if the term changes.
This reapplies bc19d43f, which was reverted by ae50776b. It also adds more test fixes.
Diffstat (limited to 'src/mongo/db/introspect.cpp')
-rw-r--r--src/mongo/db/introspect.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mongo/db/introspect.cpp b/src/mongo/db/introspect.cpp
index aa0cb13e2e9..c48ab2089eb 100644
--- a/src/mongo/db/introspect.cpp
+++ b/src/mongo/db/introspect.cpp
@@ -116,6 +116,11 @@ void profile(OperationContext* opCtx, NetworkOp op) {
const string dbName(nsToDatabase(CurOp::get(opCtx)->getNS()));
try {
+ // Even if the operation we are profiling was interrupted, we still want to output the
+ // profiler entry. This lock guard will prevent lock acquisitions from throwing exceptions
+ // before we finish writing the entry.
+ UninterruptibleLockGuard noInterrupt(opCtx->lockState());
+
bool acquireDbXLock = false;
while (true) {
std::unique_ptr<AutoGetDb> autoGetDb;