Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
net/http: data race in closing and reading from expectContinueReader () #26253
What version of Go are you using (
expectContinueReader struct has a race between methods Close and Read when accessing unprotected boolean "closed"
Is this race expected? Is there any safe way to abort http transfer on server side in net/http package?
Thanks for the code. (I now see how obvious this was from your first comment.)
Can easily recreate this race by inserting
I suppose an obvious band aid is to use a mutex. If sync.Mutex locking without contention implementation is fast (e.g. futex) then sync.Mutex should be fine.
Can you elaborate more on what this
I assume you've seen