net/http2: client immediately close most of connections via forward proxy even if idleConn was configured #50000
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
Output$ squid -v
Squid Cache: Version 3.5.20
What did you do?
I'm using Go to implement an http client and squid as a forward proxy to send requests to remote servers. Things goes well when using http/1.1 via proxy or http/1.1, http2 without proxy, however, while using http2 client via proxy, most of the connections were closed immediately and only one or two were kept. And the idleConn configuration was enabled on the http transport.
Code: https://go.dev/play/p/8gaQM-80YT8
code
What did you expect to see?
Connections will be kept whatever http protocol I used and with or without proxy.
What did you see instead?
Everything goes well when I'm using http/1.1 via proxy or http/1.1, http2 without proxy. However, when using http2 client via proxy, the connections will be created as many as the requests, then close most of them and leave only one or two connections. I capture packages with Wireshark and found that these connections were closed from the client-side initially. And all the requests done without errors.
without proxy
with proxy and http/1.1
with proxy and http2
As shown below, the other connections were closed soon after ESTABLISHED even if idleConn configuration was configured on the http transport.
Local reproducer
I make a local reproducer and do it on my own laptop.
These netstats were recored within a short time, and as we can see: http2 client connect to proxy with 5 connections(req num) and then close 4 of them and only keep one connection left.
I don't know why would this happen on http2 with a forward proxy involved. Are there any suggestions to figure it out? Thanks.
The text was updated successfully, but these errors were encountered: