summaryrefslogtreecommitdiff
path: root/src/mongo/db/introspect.cpp
diff options
context:
space:
mode:
authorTess Avitabile <tess.avitabile@mongodb.com>2018-05-18 15:46:09 -0400
committerTess Avitabile <tess.avitabile@mongodb.com>2018-05-18 17:04:36 -0400
commit6ab1592260c9b21d802aa65a11d268c0a97b11a7 (patch)
treec0bf5ec600ebd81bcd71ca2fd4c99ba3fdfa5921 /src/mongo/db/introspect.cpp
parent59239fadc01de57490a56990ee125a1ea44fb126 (diff)
downloadmongo-6ab1592260c9b21d802aa65a11d268c0a97b11a7.tar.gz
SERVER-34726 Lock acquisitions for profiling in transaction have 0 second timeout
Diffstat (limited to 'src/mongo/db/introspect.cpp')
-rw-r--r--src/mongo/db/introspect.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mongo/db/introspect.cpp b/src/mongo/db/introspect.cpp
index c48ab2089eb..493f80ccc4f 100644
--- a/src/mongo/db/introspect.cpp
+++ b/src/mongo/db/introspect.cpp
@@ -118,8 +118,12 @@ void profile(OperationContext* opCtx, NetworkOp op) {
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());
+ // before we finish writing the entry. However, our maximum lock timeout overrides
+ // uninterruptibility.
+ boost::optional<UninterruptibleLockGuard> noInterrupt;
+ if (!opCtx->lockState()->hasMaxLockTimeout()) {
+ noInterrupt.emplace(opCtx->lockState());
+ }
bool acquireDbXLock = false;
while (true) {