Skip to content

Fix multicast delivery ordering under concurrent demand - #60

Merged
twittemb merged 1 commit into
mainfrom
codex/fix-multicast-delivery-ordering
Oct 3, 2026
Merged

twittemb merged 1 commit into
mainfrom
codex/fix-multicast-delivery-ordering

Conversation

@twittemb

@twittemb twittemb commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

Concurrent multicast subscribers could advance upstream before the previous result was broadcast, allowing values to arrive out of order or termination to overtake an element. This caused the intermittent CI failure where all three subscribers received [1, 1] instead of [1, 1, 1].

Broadcast each result under the multicast state lock before making the upstream iterator available again. Add regression tests with eight registered subscribers and 100 distinct values, repeated 20 times for both normal completion and failure, and update the changelog. No public API or dependency changes.

Validation:

  • Before the fix, the new regressions produced 320 failed subscriber assertions for missing or reordered values.
  • After the fix, both CI commands passed locally: build and all 150 tests with code coverage enabled.
  • GitHub Actions passed on the identical source tree, including build, tests, coverage generation, and upload.
  • git diff --check passed.

Based on the latest main after #59; this PR contains only the multicast fix.

Broadcast each upstream result before another consumer can advance the iterator, preventing values from being reordered or overtaken by termination. Add concurrent subscriber regressions for normal completion and failure.
@twittemb
twittemb merged commit 93d173a into main Oct 3, 2026
2 checks passed
@twittemb twittemb self-assigned this Oct 3, 2026
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