You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
golang/go@88b2ccb — net/http: add multiplexed connections to the idle pool prior to delivery
Adds HTTP/2 and HTTP/3 connections to the idle pool before delivering them to the waiting request.
Fixes a race where CloseIdleConnections can run before a multiplexed connection is visible in the idle pool.
golang/go@2117d7c — net/http: use consistent IDNA processing for h1 and h2
Aligns net/http and the bundled HTTP/2 implementation on idna.Lookup.ToASCII with an ASCII fast path.
Prevents HTTP/2 pool lookups from using a different host normalization than net/http.
Impact on req
transport.go still follows the old ordering in dialConnFor: it delivers an alternate connection to the waiting request first and only puts it in the idle pool afterward. This leaves the same CloseIdleConnections race present for HTTP/2 and HTTP/3.
http.go already uses the aligned idna.Lookup.ToASCII behavior with an ASCII fast path.
internal/http2/transport.go still uses idna.ToASCII in authorityAddr without the ASCII fast path, so HTTP/2 connection-pool keys can diverge from the root transport's normalized address for IDN hosts.
Suggested action
Port 88b2ccb into transport.go, preserving req's custom transport behavior.
Align internal/http2/transport.go with the IDNA normalization used by http.go.
Add regression coverage for closing idle connections while an alternate connection is being delivered, and for IDN-based HTTP/2 connection reuse.
Upstream changes
golang/go@88b2ccb —
net/http: add multiplexed connections to the idle pool prior to deliveryCloseIdleConnectionscan run before a multiplexed connection is visible in the idle pool.golang/go@2117d7c —
net/http: use consistent IDNA processing for h1 and h2net/httpand the bundled HTTP/2 implementation onidna.Lookup.ToASCIIwith an ASCII fast path.net/http.Impact on req
transport.gostill follows the old ordering indialConnFor: it delivers an alternate connection to the waiting request first and only puts it in the idle pool afterward. This leaves the sameCloseIdleConnectionsrace present for HTTP/2 and HTTP/3.http.goalready uses the alignedidna.Lookup.ToASCIIbehavior with an ASCII fast path.internal/http2/transport.gostill usesidna.ToASCIIinauthorityAddrwithout the ASCII fast path, so HTTP/2 connection-pool keys can diverge from the root transport's normalized address for IDN hosts.Suggested action
88b2ccbintotransport.go, preserving req's custom transport behavior.internal/http2/transport.gowith the IDNA normalization used byhttp.go.