Repository navigation
Conversation
UQUICConn mirrors QUICConn, but missed two changes from the Go 1.26 QUIC rework: - Close: the handshake goroutine now always sends on signalc before checking for cancellation, and QUICConn.Close receives it before draining blockedc. UQUICConn.Close didn't, so closing during a handshake hung forever. - NextEvent: QUICConn reports a failed handshake once as QUICErrorEvent; UQUICConn never did, so a TLS failure looked like no events. Both now match QUICConn. Adds UQUICConn versions of TestQUICCanceledWaitingForData and TestQUICHandshakeError, for HelloGolang and HelloCustom; both fail without this change. Fixes refraction-networking#421 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KqYot5fp6kvHireReN6Lu7
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.
Fixes #421.
UQUICConn(u_quic.go) mirrorsQUICConn(quic.go), but two changes from the Go 1.26 QUIC handshake rework only made it intoQUICConn:Closedeadlock.quicWaitForSignalnow always sends onsignalcbefore it checks for cancellation, andQUICConn.Closereceives that send before drainingblockedc.UQUICConn.Closedidn't, so closing a connection while the handshake was waiting for data hung forever (with the handshake mutex held). This adds the<-signalcreceive, and checksctx == nilfor "never started" likeQUICConndoes.NextEventnever reported a failed handshake.QUICConn.NextEventreturns the handshake error once as aQUICErrorEvent;UQUICConn.NextEventkept returningQUICNoEvent, so a TLS-level rejection looked like a stall. This copies the same block.Both changes are line-for-line what
QUICConnalready does.Tests
u_quic_test.goaddsUQUICConnversions ofTestQUICCanceledWaitingForDataandTestQUICHandshakeError, each forHelloGolangandHelloCustom. TheClosetest fails after a 5 s timeout instead of hanging the test binary.TestUQUICCanceledWaitingForDatafails ("Close() deadlocked"),TestUQUICHandshakeErrorfails ("NextEvent() = 2, want QUICErrorEvent").go test ./...passes, andgo test -race -count=3 -run QUIC .passes.Found while bumping uTLS in a project that uses apernet/quic-go's uTLS-based Chrome parrot: its QUIC tests hung in
UQUICConn.Close. Thanks to @Capricornus007 for the analysis in #421; their suggestion of a test that checksquic.goandu_quic.gostay in sync isn't included here.🤖 Generated with Claude Code