-
Notifications
You must be signed in to change notification settings - Fork 18k
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
proposal: runtime: add a function to install a global go-routine panic handler #55038
Comments
Please note that you should fill https://github.com/golang/proposal/blob/master/go2-language-changes.md when proposing a language change. I realise that this is technically not a language change, but this is still a substantial change to how |
Why not introduce a function that lets you override func Go(handler func(
goF func(func()),
f func() ,
)) Calls to |
Duplicate of #32333 |
@wizardishungry I'm not completely sure I understand your suggestion, but if mean to say "just write a wrapper function": this is indeed easy. But the problem is that you cannot require its usage and so code that you don't have control over (or did not review throughly) can still easily crash an entire program. I think this is also described in the linked duplicate issue. We run a "modular monolith" which works really great, except that every once in a while I (or team members) for get to do a defer+recover in a function that is invoke as go-routine. The modules would be better encapsulated if uncaught panic in one go-routine did not crash all other "modules" (ie. the program). |
Right – What I'm suggesting is that you be able to register a global wrapper function. |
This proposal is a duplicate of a previously discussed proposal, as noted above, |
The text was updated successfully, but these errors were encountered: