Repository navigation
test(net): quarantine the lite-07 empty-window reply flake and plan its fix #8150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| # [S] A lite-07 reply FINs instead of resetting when the subscriber FINs mid-write | ||
|
|
||
| ## Goal | ||
|
|
||
| When a lite-07 subscriber FINs its subscription stream while the publisher's | ||
| reply write is yielding on the shared write budget, the publisher still FINs | ||
| in reply instead of resetting with Cancel. `js/net/src/lite/publisher.test.ts`'s | ||
| "lite-07 answers a bounded window that resolves empty and FINs in reply" | ||
| passes under `--rerun-each 200`, and its `test.skip` is removed. | ||
|
|
||
| ## Plan | ||
|
|
||
| Planned 2026-11-07 (maintainer, /quest-complete) from | ||
| [moq-dev/moq#7670](https://github.com/moq-dev/moq/pull/7670)'s validation: | ||
| the test fails on main 12 times in 200 under `bun test --rerun-each 200`. It | ||
| is quarantined with `test.skip` until this quest fixes it, per AGENTS.md. | ||
|
|
||
| The bug is in the product, not the test. `Writer.write` | ||
| (`js/net/src/stream.ts`) yields on the shared write budget after its bytes | ||
| are already queued. During that yield, `SubscriptionControls.response` | ||
| (`js/net/src/lite/publisher.ts`) takes the subscriber's clean FIN as | ||
| overriding the blocked write, so the publisher resets the stream. | ||
| [moq-dev/moq#8047](https://github.com/moq-dev/moq/pull/8047) fixed the same | ||
| yield's race for opened group streams only. | ||
|
|
||
| Candidate fixes: | ||
|
|
||
| - a clean FIN no longer overrides a reply write, and only an error does; | ||
| - `Writer.write` yields before handing its bytes over, not after. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
|
||
| Prefer the one that also covers every other `Writer.write` caller whose peer | ||
| can FIN during the yield. Check whether the Rust publisher has the same | ||
| ordering. Prove the fix with a test that forces the yield, not with repeated | ||
| runs. | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Script executed:
Repository: moq-dev/moq
Length of output: 9578
Script executed:
Repository: moq-dev/moq
Length of output: 19284
Script executed:
Repository: moq-dev/moq
Length of output: 39176
Web query:
WebTransport send stream writable write promise flow control peer stops reading bidirectional FIN receive side independent specificationResult:
Script executed:
Repository: moq-dev/moq
Length of output: 19545
Script executed:
Repository: moq-dev/moq
Length of output: 8435
Preserve an escape for blocked reply writes.
If the first candidate ignores clean FIN during a flow-controlled write, the write may never settle and the subscription remains held. Update the plan to distinguish the budget yield from transport backpressure, or provide another bounded cancellation path. Test both cases.