Repository navigation
js/net's reset Announce Stream test closes the session under load - #9024
Conversation
Quest-Claim: 441e55b0e9c2fe3c
…d it A reset discards what the peer has not read. Under CPU load the accept loop yields (acceptBudget) before reading the new stream, so the reset can overtake the stream type byte, and a stream of unknown type is not known to be an Announce Stream. Wait for the ANNOUNCE_OK that answers the request first. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
✅ No new issues found.
Approach: sound. The hang came from the test, not from js/net. A reset that overtakes the unread type byte leaves the stream unidentified, so the session correctly stays open. The fix waits for ANNOUNCE_OK before resetting, which proves the client has read the type byte, and it changes no production code.
Reviewed changes
I reviewed the rewritten violation case and the deletion of its quest file.
- Auth handshake in the test: the test accepts the client's Auth stream and grants
AuthOk(all, all), because the client sends nothing on its Announce Stream until its credential is granted. Before the client opens Auth, it opens no other bidi stream thatStream.acceptcould pick up instead: Probe opens only on a subscribe, and GOAWAY only on leave. - Waits for ANNOUNCE_OK before the reset: a
Readersloop skips any other uni stream and asserts that the first message on the client's Announce Stream is{ status: "ok" }. If the client ever sent a different first message, the test would fail loudly instead of hanging. - Quest file removed:
quest/m0/test-flakes-3/js-announce-reset.mdis deleted because the quest is finished.
claude-opus-5-5 | 𝕏
|
No actionable comments were generated in the recent review. WalkthroughThe reset-stream test now completes the peer’s authentication exchange, sends an Announce request, and checks for an Announce response with status Merge Risk:
|

Finishes quest/m0/test-flakes-3/js-announce-reset.md (deleted here).
Summary
The "a reset Announce Stream closes moq-lite-07 with PROTOCOL_VIOLATION" test timed out under a loaded
just check(moq-dev/moq#8996). It is a test race, not ajs/netbug.Trace. The test writes the stream type byte and an ANNOUNCE_REQUEST, then resets at once.
Readers.next()first pollsacceptBudget, which yields once 4 ms of host CPU time passed without yielding, so it does so far more often under load. If it yields, the reset reaches the mock stream before the client reads the type byte; a reset discards what is unread, so the read fails with a plain reset. A stream of unknown type is not known to be an Announce Stream, and could as well be a Group Stream reset on purpose, so the session correctly stays open and the test waits for a close that never comes. Real QUIC and WebTransport drop unread data on a reset the same way, so nojs/netchange can tell them apart. The reset path itself (#runAnnounce) closes with PROTOCOL_VIOLATION whenever the stream was identified.Fix (test only). The test now answers the client's AUTH, then waits for the ANNOUNCE_OK that answers its request, which proves the stream was identified, and only then resets.
Validation
acceptBudget.pollmocked to yield three times, the old test times out and the other nine violation cases pass.bun test src/lite/connection.test.ts --rerun-each 5under 64 CPU burners: 375 pass. The old test never failed this way in 40 reruns under the same load, since bun's time slice rarely lands there; the forced yield is the reliable reproduction.biome check,tsc --noEmit,quest check: clean.Caused by
Public API: none. Wire: none.
Models
Size: S
Implementer: Claude, claude-sonnet-5-5, unknown effort (arm B)
Review
Rewritten by
quest reviewafter each round.Head: b71863d
Base: origin/main at 2dcb5f8
Risk: medium,
the base has no RISK.md to name what is always high or customer-facing, so every change is mediumClassified: medium by default
Reviewer: Codex, gpt-6.1-sol, medium effort
Session:
01a1eb04-0464-7bc3-8e92-d1a0707ca3a0, round 1Score: 9/10,
The test waits for ANNOUNCE_OK before resetting, removing timing dependence; source review found no actionable defects, with tests intentionally not run.Rounds: 1; first round 0; findings 0: fixed 0, refuted 0, open 0
Findings: none