Skip to content

Commit

Permalink
Log worker failure
Browse files Browse the repository at this point in the history
This should help debug early exits, by giving a clear indication of when a
worker bails out. This should normally never happen; anytime it does also
decreases our parallelism (as we don't respawn the worker), so should be tracked
and avoided.
  • Loading branch information
Mark-Simulacrum committed Apr 11, 2021
1 parent e339585 commit 580db9b
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/runner/mod.rs
Expand Up @@ -101,10 +101,17 @@ pub fn run_ex<DB: WriteResults + Sync>(
let mut threads = Vec::new();

for worker in &workers {
let join = scope
.builder()
.name(worker.name().into())
.spawn(move || worker.run())?;
let join =
scope
.builder()
.name(worker.name().into())
.spawn(move || match worker.run() {
Ok(()) => Ok(()),
Err(r) => {
log::warn!("worker {} failed: {:?}", worker.name(), r);
Err(r)
}
})?;
threads.push(join);
}
let disk_watcher_thread =
Expand Down

0 comments on commit 580db9b

Please sign in to comment.