-
Type: Bug
-
Resolution: Won't Fix
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Service Arch
-
ALL
-
v8.0
-
Workload Scheduling 2024-06-10
Check of thread-shared field evades lock acquisition
The data guarded by this critical section may be read while in an inconsistent state or modified by multiple racing threads. Checking the value of a thread-shared field outside of a locked region to determine if a locked operation involving that thread shared field has completed.
/src/mongo/db/operation_context_group.cpp:66: LOCK_EVASION 141366 Thread1 uses the value read from field "_movedFrom" in the condition "!this->_movedFrom". It sees that the condition is true. Control is switched to Thread2.
/src/mongo/db/operation_context_group.cpp:66: LOCK_EVASION 141366 Thread2 uses the value read from field "_movedFrom" in the condition "!this->_movedFrom". It sees that the condition is true.
/src/mongo/db/operation_context_group.cpp:70: LOCK_EVASION 141366 Thread2 sets "_movedFrom" to a new value. Note that this write can be reordered at runtime to occur before instructions that do not access this field within this locked region. After Thread2 leaves the critical section, control is switched back to Thread1.
/src/mongo/db/operation_context_group.cpp:67: LOCK_EVASION 141366 Thread1 acquires lock "mongo::OperationContextGroup._lock".
/src/mongo/db/operation_context_group.cpp:70: LOCK_EVASION 141366 Thread1 sets "_movedFrom" to a new value. Now the two threads have an inconsistent view of "_movedFrom" and updates to fields correlated with "_movedFrom" may be lost.