-
Notifications
You must be signed in to change notification settings - Fork 39
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
Set RUST_BACKTRACE=1 for production services: create a crate and use it #5360
Comments
I definitely think this is worthwhile. Even in environments where I've had easy access to core files and easy ways to get stuff like a stack trace out, it was still very valuable to have the runtime-printed stack trace available. |
Is it possible to build the binary so it defaults to this behaviour, instead of requiring the environment be set? |
I don't have a strong opinion --- IMO, we should have some way of collecting backtraces from production crashes; if we can get this data from the core, it's maybe less pressing, but I would err on the side of including them. |
It doesn't look like it. The default panic hook calls We could set |
I like the idea of setting |
(Note to people in the future wondering -- setting a panic hook isn't enough. For example, anyhow reads |
Another consideration here is whether we want anyhow to also capture backtraces. That is controlled with both |
rust-analyzer uses the same strategy too, so we'd be in good company: |
While debugging an instance of #2416, I saw at gc08's
/pool/ext/8a199f12-4f5c-483a-8aca-f97856658a35/crypt/debug/oxz_nexus_65a11c18-7f59-41ac-b9e7-680627f996e7/oxide-nexus:default.log.1711665000
:In this case the issue is pretty clear, but I'm wondering if we've considered setting
RUST_BACKTRACE=1
in our production environment. Having backtraces is something that can definitely aid in debugging, but maybe it isn't a big deal because the core file can show what's going on. (But see #5359.)According to https://stackoverflow.com/questions/29421727/how-much-overhead-does-rust-backtrace-1-have it seems like there's some performance cost, so we'd have to measure it carefully.
Wonder if @hawkw has thoughts here.
Tasks
The text was updated successfully, but these errors were encountered: