Skip to content

Upstream Sync Report 2026-08-27: net/http idle-pool race and HTTP/2 IDNA consistency #527

Description

@imroc

Upstream changes

  • golang/go@88b2ccbnet/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@2117d7cnet/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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bughttp2Involves HTTP/2 or internal/http2 modified codemodified-stdlibInvolves modified Go stdlib files (transport.go, transfer.go, etc.)priority:mediumBug with available workaround

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions