-
Type:
Task
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Replication
-
None
-
None
-
None
-
None
-
None
-
None
-
None
What
Snapshot locked state (cancellation token, sync-source) into a local variable under the lock before entering `.then()` / `AsyncTry` continuation chains, so the lambda captures the local rather than accessing `this->_member` after the lock has been released.
Files: `file_copy_based_initial_syncer.cpp` (lines 273, 274, 756, 917, 1167), `primary_only_service_util.cpp` (line 64).
Resolves: SERVER-108529, SERVER-108530, SERVER-108705, SERVER-108720, SERVER-108731, SERVER-114658, SERVER-111263
Why
Once `.then()` is scheduled, the enclosing stack unwinds and the original lock is no longer held when the lambda executes. Snapshotting before the chain boundary closes the race structurally — the lambda no longer needs the lock because it holds an immutable local copy. Because Coverity cannot be run locally, the snapshot pattern is also self-documenting proof that the fix is correct.
- is related to
-
SERVER-108529 Coverity analysis defect 162577: Data race condition
-
- Backlog
-
-
SERVER-108530 Coverity analysis defect 162554: Data race condition
-
- Backlog
-
-
SERVER-108636 Coverity analysis defect 155327: Data race condition
-
- Backlog
-
-
SERVER-108705 Coverity analysis defect 155307: Data race condition
-
- Backlog
-
-
SERVER-108706 Coverity analysis defect 155302: Data race condition
-
- Backlog
-
-
SERVER-108707 Coverity analysis defect 155300: Data race condition
-
- Backlog
-
-
SERVER-108711 Coverity analysis defect 155139: Data race condition
-
- Backlog
-
-
SERVER-108720 Coverity analysis defect 155014: Data race condition
-
- Backlog
-
-
SERVER-108727 Coverity analysis defect 154939: Data race condition
-
- Backlog
-
-
SERVER-108731 Coverity analysis defect 154898: Data race condition
-
- Backlog
-
-
SERVER-111263 Coverity analysis defect 145051: Data race condition
-
- Backlog
-
-
SERVER-114658 Coverity analysis defect 183864: Data race condition
-
- Backlog
-