You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
tests: OperationCoordinator fixtures hold the persist gate across blocking waits #82
Found during the flake project (PR #80) and deliberately deferred: several OperationCoordinatorTests fixtures block inside coordinator-owned synchronous seams while production code holds _persistGate — e.g. persistence Action<byte[]> delegates and IServiceScopeFactory.CreateScope() fakes waiting on release events. Two consequences, both measured:
It made an otherwise-correct production change hazardous: adding a context-free yield to OperationCoordinator.RunOperationAsync (so the runner resumes on the ThreadPool) produced a real hang under 2-core stress — 1-in-30 with the change, 0-in-30 without, live stack showing the runner parked in Monitor.Enter on _persistGate while the gate holder waited for a pool thread that the runner occupied. The change was reverted (revert(backend): keep the operation runner on the scheduling caller's context), but the underlying hazard — a lock held across a blocking wait in test fixtures — remains, and constrains future scheduling changes in the coordinator.
OperationCoordinatorTests.Start_ReturnsPersistedHandleBeforeBlockedExecutor flakes under load on unmodified master (observed in local 2-core stress), same neighborhood.
After the restructuring, re-attempt the reverted RunOperationAsync context-free yield and keep it if 30×2-core stress stays clean both ways (the flake it originally fixed is real).
Start_ReturnsPersistedHandleBeforeBlockedExecutor stable across a 30-run pinned stress.
Activity