summaryrefslogtreecommitdiff
path: root/src/mongo/db/concurrency/lock_state.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/concurrency/lock_state.cpp')
-rw-r--r--src/mongo/db/concurrency/lock_state.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mongo/db/concurrency/lock_state.cpp b/src/mongo/db/concurrency/lock_state.cpp
index 508713b7d02..6cc0f0ee260 100644
--- a/src/mongo/db/concurrency/lock_state.cpp
+++ b/src/mongo/db/concurrency/lock_state.cpp
@@ -893,9 +893,10 @@ void LockerImpl::_lockComplete(OperationContext* opCtx,
_unlockImpl(&it);
});
- // This failpoint is used to time out non-intent locks if they cannot be granted immediately.
- // Testing-only.
- if (!_uninterruptibleLocksRequested &&
+ // This failpoint is used to time out non-intent locks if they cannot be granted immediately
+ // for user operations. Testing-only.
+ const bool isUserOperation = opCtx && opCtx->getClient()->isFromUserConnection();
+ if (!_uninterruptibleLocksRequested && isUserOperation &&
MONGO_unlikely(failNonIntentLocksIfWaitNeeded.shouldFail())) {
uassert(ErrorCodes::LockTimeout,
str::stream() << "Cannot immediately acquire lock '" << resId.toString()