SERVER-139053In Code Review
Load-shedding sweep reads another thread's QueryLifespan slot without synchronization
Item 1 of SERVER-138793. {{sweepQueuedOperationsForMemoryPressure}} ({{query_memory_load_shedding.cpp:475}}) runs on the monitor thread. For each client it takes the {{ClientLock}}, then calls {{QueryLifespan::getIfExists(opCtx)}} (line 504) and {{getOpState(opCtx)}} (line 507). Both read the lifespan slot, a plain {{std::shared_ptr}} decoration on the {{OperationContext}}. The op's own thread writes that slot without the {{ClientLock}}: {{QueryLifespan::get()}} (lazy create), {{bind()}}, and t