Skip to content

Commit 06c595c

Browse files
authored
Remove individual panic setup, use global panic settings (#1174)
1 parent fe0c5c7 commit 06c595c

File tree

7 files changed

+0
-78
lines changed

7 files changed

+0
-78
lines changed

agent/src/main.rs

-10
Original file line numberDiff line numberDiff line change
@@ -234,16 +234,6 @@ impl ZFSDataset {
234234

235235
#[tokio::main]
236236
async fn main() -> Result<()> {
237-
/*
238-
* If any of our async tasks in our runtime panic, then we should exit
239-
* the program right away.
240-
*/
241-
let default_panic = std::panic::take_hook();
242-
std::panic::set_hook(Box::new(move |info| {
243-
default_panic(info);
244-
std::process::exit(1);
245-
}));
246-
247237
let args = Args::try_parse()?;
248238

249239
match args {

crutest/src/main.rs

-10
Original file line numberDiff line numberDiff line change
@@ -595,16 +595,6 @@ async fn handle_signals(
595595
*/
596596
#[tokio::main]
597597
async fn main() -> Result<()> {
598-
/*
599-
* If any of our async tasks in our runtime panic, then we should
600-
* exit the program right away.
601-
*/
602-
let default_panic = std::panic::take_hook();
603-
std::panic::set_hook(Box::new(move |info| {
604-
default_panic(info);
605-
std::process::exit(1);
606-
}));
607-
608598
let opt = opts()?;
609599

610600
// If we just want the version, print that and exit.

downstairs/src/main.rs

-20
Original file line numberDiff line numberDiff line change
@@ -376,16 +376,6 @@ async fn main() -> Result<()> {
376376
root_cert_pem,
377377
mode,
378378
} => {
379-
/*
380-
* If any of our async tasks in our runtime panic, then we should
381-
* exit the program right away.
382-
*/
383-
let default_panic = std::panic::take_hook();
384-
std::panic::set_hook(Box::new(move |info| {
385-
default_panic(info);
386-
std::process::exit(1);
387-
}));
388-
389379
// Instrumentation is shared.
390380
if let Some(endpoint) = trace_endpoint {
391381
let tracer = opentelemetry_jaeger::new_agent_pipeline()
@@ -435,16 +425,6 @@ async fn main() -> Result<()> {
435425
trace_endpoint,
436426
bind_addr,
437427
} => {
438-
/*
439-
* If any of our async tasks in our runtime panic, then we should
440-
* exit the program right away.
441-
*/
442-
let default_panic = std::panic::take_hook();
443-
std::panic::set_hook(Box::new(move |info| {
444-
default_panic(info);
445-
std::process::exit(1);
446-
}));
447-
448428
// Instrumentation is shared.
449429
if let Some(endpoint) = trace_endpoint {
450430
let tracer = opentelemetry_jaeger::new_agent_pipeline()

dsc/src/main.rs

-8
Original file line numberDiff line numberDiff line change
@@ -1365,14 +1365,6 @@ fn cleanup(output_dir: PathBuf, region_dir: Vec<PathBuf>) -> Result<()> {
13651365

13661366
fn main() -> Result<()> {
13671367
let args = Args::parse();
1368-
// If any of our async tasks in our runtime panic, then we should
1369-
// exit the program right away.
1370-
let default_panic = std::panic::take_hook();
1371-
std::panic::set_hook(Box::new(move |info| {
1372-
default_panic(info);
1373-
std::process::exit(1);
1374-
}));
1375-
13761368
let runtime = Builder::new_multi_thread()
13771369
.worker_threads(10)
13781370
.thread_name("dsc")

hammer/src/main.rs

-10
Original file line numberDiff line numberDiff line change
@@ -108,16 +108,6 @@ async fn main() -> Result<()> {
108108
println!("Set up tracing!");
109109
}
110110

111-
/*
112-
* If any of our async tasks in our runtime panic, then we should
113-
* exit the program right away.
114-
*/
115-
let default_panic = std::panic::take_hook();
116-
std::panic::set_hook(Box::new(move |info| {
117-
default_panic(info);
118-
std::process::exit(1);
119-
}));
120-
121111
// Create N CruciblePseudoFiles to test activation handoff.
122112
let mut cpfs: Vec<crucible::CruciblePseudoFile<Guest>> =
123113
Vec::with_capacity(opt.num_upstairs);

measure_iops/src/main.rs

-10
Original file line numberDiff line numberDiff line change
@@ -91,16 +91,6 @@ async fn main() -> Result<()> {
9191
read_only: false,
9292
};
9393

94-
/*
95-
* If any of our async tasks in our runtime panic, then we should
96-
* exit the program right away.
97-
*/
98-
let default_panic = std::panic::take_hook();
99-
std::panic::set_hook(Box::new(move |info| {
100-
default_panic(info);
101-
std::process::exit(1);
102-
}));
103-
10494
let (guest, mut io) = Guest::new(None);
10595
let guest = Arc::new(guest);
10696

pantry/src/main.rs

-10
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,6 @@ enum Args {
2323

2424
#[tokio::main]
2525
async fn main() -> Result<()> {
26-
/*
27-
* If any of our async tasks in our runtime panic, then we should exit
28-
* the program right away.
29-
*/
30-
let default_panic = std::panic::take_hook();
31-
std::panic::set_hook(Box::new(move |info| {
32-
default_panic(info);
33-
std::process::exit(1);
34-
}));
35-
3626
let args = Args::try_parse()?;
3727

3828
match args {

0 commit comments

Comments
 (0)