Fix: a stray QUIC handshake no longer kills a direct-path send - #77
Merged
Merged
Conversation
A direct-path sender ended its whole transfer if anything reached its socket first with a QUIC handshake that failed. The network lab traced the intermittent `authentication failed` to exactly that: a late packet from a relay's address-discovery port was taken for an incoming connection, failed, and ended the send before the real receiver dialled. Plain LAN passed 1 run in 5 on main. On a public address, anyone who can send one UDP packet could do the same on purpose. A failed handshake is now dropped and the wait goes on. It is not the receiver, which completes the handshake, and not a guess, which needs a completed handshake first, so the one-guess rule is untouched. After the fix, plain LAN passed 8 runs in 8. A unit test sends a junk QUIC Initial to a waiting sender and then connects a real receiver; with the old behaviour it fails 3 times in 3. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G7Fy45hUvna94cd79WKG8S
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug in shipped releases (v0.2.0+), independent of the other open PRs. Based on
main, so it can merge on its own. It's a behaviour change, so it waits for your review.The bug
A sender on the direct path waits in
QuicEndpoint::accept_transfer. If anything reached its UDP socket first with a QUIC handshake that failed,accept_transferreturned that error and the whole send ended. The real receiver then timed out.This is the netlab
authentication failedmystery. A traced failing run:A late packet from address discovery was taken for an incoming connection. The same thing is reachable on purpose: one UDP packet to a waiting sender's public address ends its transfer.
The fix
A failed handshake is dropped and the sender keeps waiting. It can't be the receiver, which completes the handshake, and it isn't a guess, which needs a completed handshake first, so the one-guess rule (decisions 13 and 18) is untouched.
Evidence
mainpassed 1 run in 5; with this fix it passed 8 in 8.fmt,clippy -D warningsand all 181 tests onmainpass.The root cause is recorded in the netlab plan.
🤖 Generated with Claude Code
https://claude.ai/code/session_01G7Fy45hUvna94cd79WKG8S