Skip to content

Fix the Windows CI wedge: skip the per-event fsync barrier in the sessions load tests#598

Merged
tobocop2 merged 1 commit into
mainfrom
fix/sessions-load-fsync-storm
Jul 23, 2026
Merged

Fix the Windows CI wedge: skip the per-event fsync barrier in the sessions load tests#598
tobocop2 merged 1 commit into
mainfrom
fix/sessions-load-fsync-storm

Conversation

@tobocop2

Copy link
Copy Markdown
Owner

Problem

  • The Windows CI test job wedged (27 min to the 120 min timeout) on test_no_turn_is_ever_lost and test_listing_stays_correct_at_volume.
  • Both fire thousands of SessionStore writes in a tight loop, each ending in os.fsync. On Windows os.fsync is a real FlushFileBuffers disk barrier (~4ms/event measured locally vs ~0.05ms on macOS, a 77x gap); ~2200 back-to-back barriers on a throttled CI disk ran for tens of minutes. macOS/Linux never saw it (their os.fsync isn't a real barrier).

Solution

  • Neutralize os.fsync in this suite's fixture only (monkeypatch, reverts per test). No production change.
  • Safe: none of the invariants these tests assert depend on fsync — append-only, nothing-lost, torn-tail, and concurrent-writer safety rest on O_APPEND + one write per event + flush + the FileLock. All 8 tests pass fsync-free.
  • Production is untouched: real usage appends one event per user turn, seconds apart, where the barrier is cheap and buys genuine crash durability. The 2000-event volume still stresses the append/lock/read paths; only the unrealistic barrier density is removed.

test_no_turn_is_ever_lost and test_listing_stays_correct_at_volume fire thousands
of SessionStore writes in a tight loop, each ending in os.fsync. On Windows
os.fsync is a real FlushFileBuffers disk barrier (~4ms/event measured locally vs
~0.05ms on macOS, a 77x gap), so ~2200 back-to-back barriers on a throttled CI
disk ran for tens of minutes and tripped the timeout/watchdog. macOS/Linux never
saw it because their os.fsync is not a real barrier.

Neutralize os.fsync in this suite's fixture only. None of the invariants it
asserts depend on fsync -- append-only, nothing-lost, torn-tail, and
concurrent-writer safety all rest on O_APPEND, one write per event, flush, and
the FileLock. Production is untouched: real usage appends one event per user
turn, seconds apart, where the barrier is cheap and buys genuine crash
durability. Keeping the 2000-event volume still stresses the append/lock/read
paths; only the unrealistic barrier density is removed.
@tobocop2
tobocop2 merged commit 288a937 into main Jul 23, 2026
15 of 17 checks passed
@tobocop2
tobocop2 deleted the fix/sessions-load-fsync-storm branch July 23, 2026 00:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant