Repository navigation
fix(shaper): keep forwarding after a peer's port goes away - #5796
Conversation
Windows reports an ICMP port unreachable as ConnectionReset on the next recv_from, even on an unconnected UDP socket. The shaper treated that as fatal: once the relay restart drill killed its relay, the next keep-alive the shaper forwarded drew the error, the flow's reply task failed, and the whole shaper stopped, so the clients never reconnected after the retarget. Skip ConnectionReset on both receive paths, as the QUIC driver already does, and make the in-memory test socket report it the way Windows does so the unit tests catch a regression on every platform. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Outcome: root-caused from the code, not the job log (the job-log REST endpoint stayed rate-limited). On Windows, Choice made without asking: skip the error in the receive loop rather than turn off (Written by Claude Opus 5.5) |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 20 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
# Conflicts: # quest/m0/ci/README.md # quest/m0/ci/platform-queue.md
|
Merging. The shaper now skips Review: Codex reviewed head Decisions were settled earlier (skip rather than Follow-up: have the drills' (Written by Claude Opus 5.5) |
# Conflicts: # quest/m0/ci/README.md
This PR fixes the drill and deletes its quest, so the link no longer resolves. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Quest:
quest/m0/ci/platform-windows-drill.md(deleted here; references removed fromquest/m0/ci/README.mdandquest/m0/ci/platform-queue.md).Root cause
The Windows failure is in the test's UDP shaper, not the relay or the reconnect loop.
Windows reports an ICMP port unreachable as
WSAECONNRESET(io::ErrorKind::ConnectionReset) on the nextrecv_from, even on an unconnected UDP socket. Linux and macOS stay silent there.moq-shapertreated any receive error as fatal:recv_fromreturnsConnectionReset. The flow'sreplytask fails,runpropagates it throughjoin_next, and the whole shaper stops forwarding.Disconnected(idle timeout). Afterretarget, nothing forwards, so neither reachesConnected. That matches the panic inexpect_statusatdrills.rs:661, in both lanes, since test(relay): restart the crash drill on a fresh port behind a stable address #5160 put both lanes behind a shaper.The shaper only records the error in
failed, whichverify()reads at the end of the drill. The panic comes first, so the CI log never shows the error.The QUIC driver already skips
ConnectionReseton receive (rs/moq-tokio/src/quic/driver/endpoint.rs). The shaper now does the same on both receive paths: the listening socket (a closed client) and each flow's socket (a dead target).When it started: Windows ran no tests until #5557 (2026-10-15) fixed the clippy-driver path, and Platform moved into the merge queue in #5488. The bug itself goes back to the drill's shaper path (#4054, then #5160 for the loopback lane). I couldn't confirm this from the Windows job log: the REST endpoint for job logs stayed rate-limited.
Regression test
The shaper's unit tests run on an in-memory socket (
mem.rs). It now reports a send to an unbound port the way Windows does: the sender's next receive fails withConnectionReset. That stricter model applies on every platform, so Linux CI catches a regression. All existing tests pass under it. Two new tests fail without the fix (one times out, one gets an empty echo) and pass with it:a_closed_target_loses_datagrams_until_a_retargeta_closed_client_leaves_the_others_forwardingOn Windows, the drill itself (
moq-relay::drills relay_killed_mid_group_aborts_then_resumes, both lanes) is the end-to-end check in the merge queue.Checks
cargo nextest run -p moq-shaper: pass (the new tests fail before the fix)cargo nextest run -p moq-relay --test drillson Linux: 14/14 passcargo clippy -p moq-shaper --all-targets --all-features -D warnings,cargo fmt --check,quest check: cleanDecisions (settled by the maintainer)
ConnectionResetin the shaper's receive loop, matching the QUIC driver, rather than turning offSIO_UDP_CONNRESETwithWSAIoctl. Skipping is portable and needs nowindows-sysorunsafein a test crate.The Windows proof is the merge-queue Platform run.
API / wire impact
None.
moq-shaperispublish = false, and the new helper is private.Follow-ups
Path'sDropin the drills print the shaper's failure. The drill would then show "the shaper stopped forwarding" instead of only a status timeout.(Written by Claude Opus 5.5)
🤖 Generated with Claude Code