Repository navigation
Fix the two Windows race-job flakes: pipe listener hang and QUIC port collision - #36
Merged
Merged
Conversation
v0.6.2's win32PipeListener.Close could wait forever: when Close lands while an Accept is pending, ConnectNamedPipe can race the handle close and report something other than ErrFileClosed (e.g. ERROR_NO_DATA). listenerRoutine then treats the listener as still open, never closes doneCh, and Close blocks on it. ipc.Serve waits for that Close before returning, so TestPipeSecondServerRejected hung the race job until the 10m test timeout. v0.6.4 makes listener closure authoritative on that path. Its ErrPipeListenerClosed is now a deprecated alias of net.ErrClosed, so isListenerClosed matches net.ErrClosed directly, like the unix side. x/sys v0.49.0 comes along as winio's minimum.
The harness starts the gateway on an ephemeral TCP control port, and the gateway binds UDP on the same number for QUIC. Nothing makes that number free for UDP: Windows runners reserve UDP ranges and system services hold UDP ports exclusively, so the bind sporadically fails with WSAEACCES. The gateway then serves TCP only, as designed, and TestQUICRoundTrip and TestQUICMultiplexesPlayers wait out their 10s deadline on a tunnel that can never come up. It failed the race job on a dependabot PR in August and again on #35. Gateway.QUICAddr reports the bound UDP address (nil when QUIC is off or its bind failed), and startGateway retries on a fresh port while it is nil, so every harness with QUIC enabled really has it.
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.
The
racejob on #35 failed on the same commit that had just passed. Two unrelated flakes, both on the Windows runner:TestPipeSecondServerRejectedhung until the 10m test timeout. The goroutine dump showsipc.Servewaiting on go-winio'swin32PipeListener.Close, which waits on adoneChthatlistenerRoutinenever closes. In v0.6.2, ifCloselands while anAcceptis pending,ConnectNamedPipecan race the handle close and return something other thanErrFileClosed. The listener then counts itself as still open. go-winio v0.6.4 fixes exactly this path: listener closure is authoritative there. ItsErrPipeListenerClosedis now a deprecated alias ofnet.ErrClosed, soisListenerClosedmatchesnet.ErrCloseddirectly, as the unix side already does. v0.6.4 needs Go 1.26, which is why this PR is stacked on #35.TestQUICRoundTrip/TestQUICMultiplexesPlayerstimed out withlisten udp 127.0.0.1:N: ... forbidden by its access permissions(WSAEACCES). The harness starts the gateway on an ephemeral TCP port, and the gateway binds UDP on the same number; on Windows that UDP port can be reserved or held exclusively. The gateway then serves TCP only, by design, so the QUIC tests can't pass. The same failure hit a dependabot PR's race job in August. The newGateway.QUICAddr()reports the bound UDP address, or nil when QUIC is off or its bind failed. The harness'sstartGatewayretries on a fresh port while it is nil. No product behaviour changes.New versions: go-winio v0.6.4 (2026-10-13), x/sys v0.49.0 (2026-10-06, winio's minimum). Both are outside the 7-day cooldown.
Verified:
go test -short ./...green on Linux.QUICAddr()was nil, the harness shut each gateway down cleanly (goleak quiet), retried, then failed with its message. With the port freed, QUIC bound.racejob is the real check.Merging this into
fix/security-workflowputs both fixes on #35, so #35's next CI run includes them.