Skip to content

Commit

Permalink
Fixes #16063: Enable backtrace in relayd
Browse files Browse the repository at this point in the history
  • Loading branch information
amousset committed Oct 25, 2019
1 parent 50bf22b commit bdbc31b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
10 changes: 5 additions & 5 deletions relay/sources/relayd/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions relay/sources/relayd/fuzz/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion relay/sources/relayd/src/relayd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
use relayd::{
check_configuration, configuration::cli::CliConfiguration, error::Error, init_logger, start,
};
use std::process::exit;
use std::{env, process::exit};
use structopt::StructOpt;
use tracing::error;

Expand All @@ -45,6 +45,12 @@ fn error_code(e: &Error) -> i32 {

/// Everything in a lib to allow extensive testing
fn main() {
// https://www.reddit.com/r/rust/comments/bnqina/why_does_not_rust_give_a_backtrace_by_default/
// https://internals.rust-lang.org/t/rust-backtrace-in-production-use/5609/2
// May be expensive only when backtraces are actually produced
// and can be helpful to troubleshoot production crashes
env::set_var("RUST_BACKTRACE", "1");

let cli_cfg = CliConfiguration::from_args();
if cli_cfg.check_configuration {
if let Err(ref e) = check_configuration(&cli_cfg.configuration_dir) {
Expand Down

0 comments on commit bdbc31b

Please sign in to comment.