Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
net/http: data race reading a "Expect: 100-Continue" request while writing response #13050
The goroutine reading the request body will be updating "ecr.sawEOF", while the goroutine writing the response will be reading that boolean with no synchronization.
Unlike the client code, the net/http Server code does not use different goroutines for reading vs. writing.
Your Handler runs in the same goroutine that is reading the request (and request body) and writing the response (and response body).
Can you share your code or a minimal repro?
Are you using TimeoutHandler perhaps?
The handler spawns a goroutine extra in order to handle streaming in a