Skip to content

Commit

Permalink
die without generating core (openzfs#479)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahrens authored Oct 3, 2021
1 parent e7bed08 commit 0db0780
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 2 deletions.
46 changes: 46 additions & 0 deletions cmd/zfs_object_agent/Cargo.lock

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

1 change: 1 addition & 0 deletions cmd/zfs_object_agent/zettacache/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ edition = "2018"
anyhow = "1.0"
async-stream = "0.3.0"
async-trait = "0.1.51"
backtrace = "0.3"
bincode = "1.3.2"
chrono = "0.4"
config = "0.11"
Expand Down
7 changes: 5 additions & 2 deletions cmd/zfs_object_agent/zettacache/src/die.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
//! caller and having it "always" die on that caller.

use crate::get_tunable;
use backtrace::Backtrace;
use lazy_static::lazy_static;
use log::*;
use std::{
Expand Down Expand Up @@ -69,8 +70,10 @@ where
}
if location == *DIE_LOCATION {
let msg = f();
warn!("exiting to test failure handling: {}", msg);
panic!("exiting to test failure handling: {}", msg);
let backtrace = Backtrace::new();
warn!("exiting to test failure handling: {} {:?}", msg, backtrace);
println!("exiting to test failure handling: {} {:?}", msg, backtrace);
std::process::exit(0);
}
}
}
Expand Down

0 comments on commit 0db0780

Please sign in to comment.