Skip to content
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

Remove individual panic setup, use global panic settings #1174

Merged
merged 1 commit into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions agent/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,16 +234,6 @@ impl ZFSDataset {

#[tokio::main]
async fn main() -> Result<()> {
/*
* If any of our async tasks in our runtime panic, then we should exit
* the program right away.
*/
let default_panic = std::panic::take_hook();
std::panic::set_hook(Box::new(move |info| {
default_panic(info);
std::process::exit(1);
}));

let args = Args::try_parse()?;

match args {
Expand Down
10 changes: 0 additions & 10 deletions crutest/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -595,16 +595,6 @@ async fn handle_signals(
*/
#[tokio::main]
async fn main() -> Result<()> {
/*
* If any of our async tasks in our runtime panic, then we should
* exit the program right away.
*/
let default_panic = std::panic::take_hook();
std::panic::set_hook(Box::new(move |info| {
default_panic(info);
std::process::exit(1);
}));

let opt = opts()?;

// If we just want the version, print that and exit.
Expand Down
20 changes: 0 additions & 20 deletions downstairs/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -376,16 +376,6 @@ async fn main() -> Result<()> {
root_cert_pem,
mode,
} => {
/*
* If any of our async tasks in our runtime panic, then we should
* exit the program right away.
*/
let default_panic = std::panic::take_hook();
std::panic::set_hook(Box::new(move |info| {
default_panic(info);
std::process::exit(1);
}));

// Instrumentation is shared.
if let Some(endpoint) = trace_endpoint {
let tracer = opentelemetry_jaeger::new_agent_pipeline()
Expand Down Expand Up @@ -435,16 +425,6 @@ async fn main() -> Result<()> {
trace_endpoint,
bind_addr,
} => {
/*
* If any of our async tasks in our runtime panic, then we should
* exit the program right away.
*/
let default_panic = std::panic::take_hook();
std::panic::set_hook(Box::new(move |info| {
default_panic(info);
std::process::exit(1);
}));

// Instrumentation is shared.
if let Some(endpoint) = trace_endpoint {
let tracer = opentelemetry_jaeger::new_agent_pipeline()
Expand Down
8 changes: 0 additions & 8 deletions dsc/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1365,14 +1365,6 @@ fn cleanup(output_dir: PathBuf, region_dir: Vec<PathBuf>) -> Result<()> {

fn main() -> Result<()> {
let args = Args::parse();
// If any of our async tasks in our runtime panic, then we should
// exit the program right away.
let default_panic = std::panic::take_hook();
std::panic::set_hook(Box::new(move |info| {
default_panic(info);
std::process::exit(1);
}));

let runtime = Builder::new_multi_thread()
.worker_threads(10)
.thread_name("dsc")
Expand Down
10 changes: 0 additions & 10 deletions hammer/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,16 +108,6 @@ async fn main() -> Result<()> {
println!("Set up tracing!");
}

/*
* If any of our async tasks in our runtime panic, then we should
* exit the program right away.
*/
let default_panic = std::panic::take_hook();
std::panic::set_hook(Box::new(move |info| {
default_panic(info);
std::process::exit(1);
}));

// Create N CruciblePseudoFiles to test activation handoff.
let mut cpfs: Vec<crucible::CruciblePseudoFile<Guest>> =
Vec::with_capacity(opt.num_upstairs);
Expand Down
10 changes: 0 additions & 10 deletions measure_iops/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,6 @@ async fn main() -> Result<()> {
read_only: false,
};

/*
* If any of our async tasks in our runtime panic, then we should
* exit the program right away.
*/
let default_panic = std::panic::take_hook();
std::panic::set_hook(Box::new(move |info| {
default_panic(info);
std::process::exit(1);
}));

let (guest, mut io) = Guest::new(None);
let guest = Arc::new(guest);

Expand Down
10 changes: 0 additions & 10 deletions pantry/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,6 @@ enum Args {

#[tokio::main]
async fn main() -> Result<()> {
/*
* If any of our async tasks in our runtime panic, then we should exit
* the program right away.
*/
let default_panic = std::panic::take_hook();
std::panic::set_hook(Box::new(move |info| {
default_panic(info);
std::process::exit(1);
}));

let args = Args::try_parse()?;

match args {
Expand Down
Loading