Skip to content

transport: add multiplexed conns to the idle pool before delivery - #555

Open
lidongze1002 wants to merge 1 commit into
imroc:masterfrom
lidongze1002:fix/idle-pool-idna-sync
Open

lidongze1002 wants to merge 1 commit into
imroc:masterfrom
lidongze1002:fix/idle-pool-idna-sync

Conversation

@lidongze1002

Copy link
Copy Markdown

Fixes #527.

Ports the two upstream changes the report tracks:

  1. Multiplexed connections enter the idle pool before delivery (transport.go, upstream golang/go@88b2ccb). dialConnFor delivered an alt (HTTP/2 or HTTP/3) connection to the waiting request first and only then added it to the idle pool, so a concurrent CloseIdleConnections could run in that window and miss it. The connection is now added to the pool before tryDeliver; non-shareable connections are still added only when delivery did not take them.
  2. Consistent IDNA processing (internal/http2/transport.go, internal/http3/request_writer.go, internal/netutil/addr.go, upstream golang/go@2117d7c). These used idna.ToASCII, while http.go uses idna.Lookup.ToASCII; they now use the same lookup profile, so HTTP/2 pool keys and HTTP/1 host normalization agree.

Verification

go vet ./internal/netutil/... ./internal/http2/... ./internal/http3/... .
go test ./internal/netutil/... ./internal/http2/... ./internal/http3/...
ok  github.com/imroc/req/v3/internal/netutil
ok  github.com/imroc/req/v3/internal/http2
ok  github.com/imroc/req/v3/internal/http3

go test . still has the pre-existing Windows-only failures (e.g. TestSetFile compares the platform's open error text to "no such file"); they are unrelated to these files.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant