IoUringAssmEngine: Acquire spinlock in stall timeout branch

This commit is contained in:
2025-11-08 21:54:11 -04:00
parent d8a3999ad5
commit 5b7b4f215a
@@ -418,6 +418,23 @@ public:
// Check if timer was cancelled (ignore if operation_aborted)
if (error == boost::asio::error::operation_aborted) { return; }
/** EXPLANATION:
* This lock acquisition here will also cover the call to
* assembleFrameReq3 below. Because of that, it means that the
* requirement that the lock be held while accessing
* the metadata that's destroyed in stop() is satisfied.
*
* In theory though, we shouldn't need to hold the lock into
* assembleFrameReq3 below because that function doesn't really access
* any state that's destroyed in stop()? But I'm not sure, and we have
* indeed seen a SEGFAULT even in the current code with locking, so
* I'm going to hold the lock here for now.
*/
SpinLock::Guard lock(context->engine.isAssemblingLock);
if (!context->engine.isAssembling)
{ return; }
// Set timer fired flag
context->timerFired.store(true);
context->assembleFrameReq3(context);