Skip to content

fix(quic): report unreachable sends through moq-quic - #5868

Merged
kixelated merged 2 commits into
mainfrom
quic-unreachable
Oct 17, 2026
Merged

kixelated merged 2 commits into
mainfrom
quic-unreachable

Conversation

@kixelated

Copy link
Copy Markdown
Collaborator

Problem

#5668 made a dial fail at once when the peer has no route, but moq-quic had no input for it. Each driver repeated the same steps: close with application code 0 (queueing a CONNECTION_CLOSE to a peer it cannot reach), then fake a NO_VIABLE_PATH TransportError the state machine never recorded. moq-tokio did it in two places and moq-uring in a third.

Separately, moq-tokio's server socket sent through the deprecated UdpSocketState::send, which logs and drops every error except WouldBlock. The client path used try_send, so only the client half of moq-tokio ever saw an unreachable send.

Approach

  • moq_quic::Connection::handle_unreachable(): a handshaking connection is killed with a recorded NO_VIABLE_PATH (reported as Event::ConnectionLost, drained at once, nothing sent). An established connection is left alone, keeping fix(quic): fail a dial at once when the peer has no route #5668's choice that a route that drops for a moment counts as loss.
  • moq-tokio's driver calls it from drive_transmit after is_unreachable_err, and the special case in ConnectionDriver::poll is gone. moq-uring's endpoint calls it on every connection to the unreachable peer and kicks the driver, so Inner::unreachable and the is_handshaking filter are gone too.
  • The send-error policy (unreachable comes back, EMSGSIZE is silent on Unix, anything else is logged at most once a minute and treated as loss) moves into one send_failed helper. The client's UdpSenderHelper and the server Socket both use it, and the server switches to try_send.
  • UdpSocketState::send is deleted on unix, windows and wasi, along with the now-unused log_sendmsg_error, IO_ERROR_LOG_INTERVAL and last_send_error state in moq-sock.
  • The moq-quic README carried-changes entry now names the entry point.

Tests: moq-quic unit tests for both cases (handshake fails with NO_VIABLE_PATH and sends nothing, so the server never sees an Initial; established ignores it and still delivers a stream). A Linux test drives the server Socket at a v4-mapped address on an IPv6-only socket and checks that ENETUNREACH comes back; the old send returned Ok. The #5668 driver tests in moq-tokio and moq-uring still pass.

Impact

  • moq-quic: adds Connection::handle_unreachable(&mut self).
  • moq-sock: removes the deprecated UdpSocketState::send on every platform. Use try_send and classify errors with is_msg_size_err and is_unreachable_err.
  • moq-tokio: no public API change. A server handshake toward an unroutable client now fails at once with NO_VIABLE_PATH rather than idling out.
  • moq-uring: no public API change.
  • Wire: none. No frames, codes or transport parameters change, and an unreachable handshake still sends nothing.

Alternatives

  • Passing the io::Error (or a reason string) into handle_unreachable so the transport error carries the OS message. I left it out to keep moq-quic sans-IO; drivers log the OS error at debug.
  • Routing the server Socket through UdpSenderHelper. That would have meant replacing its shared write-readiness fan-out and release handling, which is out of scope here.

Follow-ups

None.

🤖 Generated with Claude Code

(Written by Claude Opus 5.5)

@kixelated
kixelated marked this pull request as ready for review October 17, 2026 16:30
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-17T16:32:14.841378Z d3c0f7e Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You'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 38 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0efcde0a-e3d9-4adf-8fb3-836b3da83b36
📥 Commits

Reviewing files that changed from the base of the PR and between 291e392 and d3c0f7e.

📒 Files selected for processing: 13
  • rs/moq-quic/README.md
  • rs/moq-quic/src/connection/mod.rs
  • rs/moq-quic/src/tests/mod.rs
  • rs/moq-sock/src/udp/mod.rs
  • rs/moq-sock/src/udp/unix.rs
  • rs/moq-sock/src/udp/wasi.rs
  • rs/moq-sock/src/udp/windows.rs
  • rs/moq-tokio/src/quic/backend.rs
  • rs/moq-tokio/src/quic/driver/connection.rs
  • rs/moq-tokio/src/quic/driver/mod.rs
  • rs/moq-tokio/src/quic/driver/runtime/mod.rs
  • rs/moq-uring/src/quic/driver/connection.rs
  • rs/moq-uring/src/quic/driver/endpoint.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@kixelated
kixelated added this pull request to the merge queue Oct 17, 2026
Merged via the queue into main with commit 8332188 Oct 17, 2026
10 of 12 checks passed
@kixelated
kixelated deleted the quic-unreachable branch October 17, 2026 16:53
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