Repository navigation
fix(quic): report unreachable sends through moq-quic - #5868
Conversation
…socket swallowing them 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. |
|
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 38 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 |
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_PATHTransportErrorthe 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 exceptWouldBlock. The client path usedtry_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 recordedNO_VIABLE_PATH(reported asEvent::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.drive_transmitafteris_unreachable_err, and the special case inConnectionDriver::pollis gone. moq-uring's endpoint calls it on every connection to the unreachable peer and kicks the driver, soInner::unreachableand theis_handshakingfilter are gone too.EMSGSIZEis silent on Unix, anything else is logged at most once a minute and treated as loss) moves into onesend_failedhelper. The client'sUdpSenderHelperand the serverSocketboth use it, and the server switches totry_send.UdpSocketState::sendis deleted on unix, windows and wasi, along with the now-unusedlog_sendmsg_error,IO_ERROR_LOG_INTERVALandlast_send_errorstate in moq-sock.Tests: moq-quic unit tests for both cases (handshake fails with
NO_VIABLE_PATHand sends nothing, so the server never sees an Initial; established ignores it and still delivers a stream). A Linux test drives the serverSocketat a v4-mapped address on an IPv6-only socket and checks thatENETUNREACHcomes back; the oldsendreturnedOk. The #5668 driver tests in moq-tokio and moq-uring still pass.Impact
moq-quic: addsConnection::handle_unreachable(&mut self).moq-sock: removes the deprecatedUdpSocketState::sendon every platform. Usetry_sendand classify errors withis_msg_size_errandis_unreachable_err.moq-tokio: no public API change. A server handshake toward an unroutable client now fails at once withNO_VIABLE_PATHrather than idling out.moq-uring: no public API change.Alternatives
io::Error(or a reason string) intohandle_unreachableso the transport error carries the OS message. I left it out to keep moq-quic sans-IO; drivers log the OS error at debug.SocketthroughUdpSenderHelper. 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)