-
Notifications
You must be signed in to change notification settings - Fork 18k
runtime: concurrent map iter+write fatal doesn't respect GOTRACEBACK #68019
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
Comments
Similar Issues
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.) |
It says the following in runtime1.go
|
CC @prattmic I know some time ago you reorganized the fatal/panic/throw code in the runtime, I'm not sure how long ago it was, but possibly relevant? Also, would this still be a problem with the new map implementation? Putting this into backlog in any case. |
Yes, the reorganization was in CL 390421, though I don't think it affected map fatal error behavior. The new maps will behave the same, they use the same fatal path. All is forced for fatal calls (== throwTypeUser) here. I think it could be changed to not force all easily if we choose to do so. FWIW, I think getting all goroutines for races is useful since you might want to try to find the other side of the race. But we should probably respect GOTRACEBACK. |
Change https://go.dev/cl/649535 mentions this issue: |
Go version
go version go1.22.4 linux/amd64
What did you do?
What did you see happen?
... we hit the race on the map in prod after an hour and 💣
The Go runtime then did its
fatal
:But then we got 3 GB of GOTRACEBACK stacks from the Go runtime for 1M+ stacks, about 3 GB more than we needed to find the bug, overwhelming our logging system in the process, causing a secondary outage.
GOTRACEBACK docs say:
And arguably a map race is internal to the run-time insofar as maps are implemented in the runtime.
But the Go runtime know it's the user's fault; note the "but is used when user code is expected to be at fault for the failure" bit here:
What did you expect to see?
I'd expect
fatalthrow(throwTypeUser)
to be treated as a normal panic withGOTRACEBACK=single
respected.Currently it's ignored:
(At least
none
works, but that's too quiet, hiding the actual problem).The text was updated successfully, but these errors were encountered: