-
Notifications
You must be signed in to change notification settings - Fork 17.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
net/http: shouldRetryRequest won't send a failed request on old connection #34455
Comments
There were substantial changes to |
After reading the 1.13 code,i think it's the same logic, except that 1.13 add function for http2. |
Can you provide a concrete program that demonstrates the problem, perhaps using |
Ok,i will write a script to test it,it may help to find whether it will leak unused persist connection. |
Closing old issues that still have the WaitingForInfo label where enough details to investigate weren't provided. Feel free to leave a comment with more details and we can reopen. |
@mvdan Sorry about the long time to reply. I review the code again, it doesn't need to close the conn even when |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Code review
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Code review
What did you expect to see?
In file net/http/transport.go
func (t *Transport) roundTrip(req *Request) (*Response, error)
After
pconn.alt.RoundTrip(req)
return err not nil, it will callpconn.shouldRetryRequest
to seewhether we should retry sending a failed HTTP request on a new connection
.But whether
shouldRetryRequest
return true or false, it won't use the old connection(It will callgetConn
to get a new idle connection). And the old connection(pconn) still there without closing.What did you see instead?
I think transport should :
The text was updated successfully, but these errors were encountered: