-
Type: Improvement
-
Resolution: Works as Designed
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Execution Team 2022-08-22, Execution Team 2022-09-05
Running
resmoke --suites=concurrency jstests/concurrency/fsm_workloads/CRUD_and_commands_with_createindexes.js
with this diff
diff --git a/src/mongo/db/concurrency/exception_util.h b/src/mongo/db/concurrency/exception_util.h index 6cfe238ca7d..63243009bac 100644 --- a/src/mongo/db/concurrency/exception_util.h +++ b/src/mongo/db/concurrency/exception_util.h @@ -34,6 +34,7 @@ #include "mongo/db/operation_context.h" #include "mongo/util/assert_util.h" #include "mongo/util/fail_point.h" +#include "mongo/util/stacktrace.h" namespace mongo { @@ -124,6 +125,10 @@ auto writeConflictRetry(OperationContext* opCtx, StringData opStr, StringData ns int attemptsTempUnavailable = 0; while (true) { try { + if (opCtx->lockState()->isLocked()) { + printStackTrace(); + } + return f(); } catch (WriteConflictException const&) { CurOp::get(opCtx)->debug().additiveMetrics.incrementWriteConflicts(1);
Shows that this writeConflictRetry is run with locks acquired at some earlier point. This is problematic because if a WriteConflictException is thrown, the locks and ticket will be held in logWriteConflictAndBackoff, which sleeps.
- related to
-
SERVER-65418 Query plan executor must release resources before backing off
- Backlog