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: Response.Body should be closed while RoundTripper returned a response & error #7620
Labels
Milestone
Comments
I suppose we could do this (harmless enough), but it's really a bug in your RoundTripper implementation. The log warning is there to tell you that you've implemented RoundTripper incorrectly. Labels changed: added release-go1.3maybe, repo-main. Owner changed to @bradfitz. Status changed to Accepted. |
This patch (against release branch) fixes this bug in persistConn (where it actually happens). If it's ok I'll send a CL against tip. Attachments:
|
CL sent: https://golang.org/cl/84850043 |
On second thought, maybe this whole gzip reader thing is wrong. Why would persistConn even look at the gzip header at all? The server has returned a response, so what if the body is corrupted, it should only matter if user actually tries to read the body, it shouldn't shadow any actual response and error the server returned. |
thanks a lot, i think this will solve my problem https://groups.google.com/forum/#!topic/golang-nuts/FnJZ9iZ0i_g |
CL https://golang.org/cl/84850043 references this issue. |
CL https://golang.org/cl/86290043 mentions this issue. |
CL https://golang.org/cl/86290043 mentions this issue. |
This issue was updated by revision 6278a95. Fixes issue #7569 LGTM=adg R=golang-codereviews, adg CC=dsymonds, golang-codereviews, rsc https://golang.org/cl/86290043 |
I tested the script with revision 07e31caba5b6. It now stop leaking. But I don't know whether 07e31caba5b6 will solve the problem https://groups.google.com/forum/#!topic/golang-nuts/FnJZ9iZ0i_g. |
Fixed as part of https://golang.org/cl/86290043 Related bug now moved to issue #7750. Status changed to Fixed. |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
by ucgggg:
The text was updated successfully, but these errors were encountered: