Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
net/http: http2 clientConnPool may cache a dead connection forever (write tcp use of closed network connection) #39750
What version of Go are you using (
This covers multiple issues already reported, some with awaiting fixes, others with awaiting responses.
There is no guarantee that the http side and the http2 side are actually in agreement. There are many more cases where the http side believes that http2 connections are still alive and valid. However, when they are used, that is when the detection kicks in.
The only safe way out of many of these situations currently is setting write timeouts.
@fraenkel I just go through the cases you provided above. It looks quite similar to my problem.
For now, the underlying tcp connections mostly rely on the
I agree with this detection strategy. But in my case, the
Setting write timeout just fixed the application hanging problem you mentioned above, it has no impact on dead connections.
It is proved by the code that currently we do not invoke any detection in writing: When an error occurs in writing, errors are returned to caller and nothing else was performed.