Repository navigation
JasperFx 2.36.1
Fixes
#572 — ShardStatusWatcher could still lose a wakeup after 2.36.0 (#573)
2.36.0's fix for #568 narrowed the window in which a WaitForShardState / WaitForShardCondition call could miss an already-published state, but could not close it: the snapshot the watcher re-checked was written by the very publication walk it was racing. A watcher could subscribe too late for the walk and read the snapshot before that walk had recorded the state — so neither path saw it. With nothing further published for that shard, the wait could only end in a timeout no matter how generous the budget. Reported from marten#5054, where it made HighWaterAgentTests.skips_multiple_gaps_and_keeps_advancing fail reproducibly on 2.36.0 and never on 2.35.0.
ShardStateTracker.PublishAsync now records the state synchronously before posting to the block, so a snapshot read can never lag a publication the caller has already made, and subscribing plus reading the snapshot is a single atomic step against the publication walk. Observers are still notified outside the lock.
Also fixed along the way: _listeners and _states were read-modify-write on plain fields, so two concurrent Subscribe calls could drop one subscriber outright — a permanently lost wakeup rather than a delayed one.
Anyone on 2.36.0 should upgrade.