Join GitHub today
net/http: a "bad" connection could potentially block all https requests #28824
In out production environment, we found all the outgoing https requests with different destination address happened to blocked at the same time and last for about 14 miniutes, while the http requests were not.
So I check the net/http source code (https://github.com/golang/go/blob/ac7c0ee26dda18076d5f6c151d8f920b43340ae3/src/net/http/h2_bundle.go), and found the "block logic", as show below.
A https request goes through a few stages, step1 get connection, step2 write headers, ...
step1, get connection
step2, write headers
If a request write headers but block in step2-3,
I check the sysctl configuration, the total retransmission timeout is just about 14minutes(with TCP_RTO_MAX = 120):
The latest code (e8a95ae) maybe have the same problem,
The production Go version is go1.10.1, and I reproduce the problem with go1.11.2.
Run the code, and shutdown 172.28.128.3 server by pulling power at "2018-11-16 18:17:01",
Killing local http2 server is different with pulling power (the "shutdown" in previous comment is pulling power exactly).
Killing local http2 server,: