x/net/http2: clarifying concurrent Close on requestBody #17589
Closed
Labels
Milestone
Comments
io.Closer and io.Reader are not in general safe for concurrent uses. Does this affect any code in the wild? |
Not to my knowledge |
Okay, then I'm going to close this. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
What version of Go are you using (
go version
)?go version go1.7.1 darwin/amd64
What operating system and processor architecture are you using (
go env
)?What did you do?
Read golang/net@40a0a18
What did you expect to see?
Based on the commit message, support for concurrent calls to requestBody.Close.
What did you see instead?
A closed bool field that makes Close() idempotent but not goroutine safe.
Supporting concurrent Close() may not be worth the effort. I've been bitten by it once due to defers and timeouts but that was my fault and now context makes that stuff much simpler. The commit message could be clearer about what the closed bool is for though.
The text was updated successfully, but these errors were encountered: