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: concurrent map writes #31352
Comments
With
|
Looking at the code it seems every place |
we don't use any cgo or any atomic tricks afaik, only external library we use is boltdb, I'm still digging and I looked at every single file from the full trace (including our code), everything is either using a mutex or only set once on initalization. Here's the weird part though, without |
That’s not too surprising; the race detector is far more sensitive than the best effort concurrent map write detection in the runtime. Can you start removing chunks of startup code to narrow down the source of the race? |
I will try sometime tomorrow. |
@OneOfOne are you copying or deriving a value from |
Possibly related, #30597 |
@davecheney We do not, we create a new Me and a co-worker have been scratching our heads trying to figure it out for a few days now. Also #30597 uses |
You are making a value copy of the http.Transport somewhere, instead of copying a pointer to the Transport. That copies the map between the two Transports but now protected by different locks. Vet should be able to tell you where.
|
@rsc thank you for pointing that out, the We run |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes, maybe?
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
We have a long running service that makes http requests using a single
http.Client
Every few days we get the provided crash/panic, gonna try to run it with
-race
but I'm not sure we can afford that for longer than a few hours.I'm trying to make a reliable reproducer but I can't figure it out, the crash points to runtime.
What did you expect to see?
No panic.
What did you see instead?
The text was updated successfully, but these errors were encountered: