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: data race in closing http.Response.Body when still reading it #9946
Comments
It looks like at can be harmful. Consider that bodyEOFSignal reads Probably we need to do: waitForBodyRead <- err == nil && and then: case a := <-waitForBodyRead: |
Flaked on race builder while trying https://go-review.googlesource.com/#/c/7570:
https://storage.googleapis.com/go-build-log/9125f9a4/linux-amd64-race_77dfbf50.log It seems to reproduce reliably with this change. |
How is this race possible? We only write to alive unsynchronized when we have no body and we only install the function that is racing with that write when we do have a body. |
Perhaps there were 2 requests on the connection: one with a body and another without a body. |
I have a revised fix for this. Just needs a new test. |
I might fix this through https://go-review.googlesource.com/#/c/9120/ |
They share a
alive
variable, and this may be the problem.The text was updated successfully, but these errors were encountered: