Skip to content

Commit

Permalink
osrdyne: address review comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Khoyo committed Jul 23, 2024
1 parent 05f1e4b commit 1487784
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion osrdyne/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,14 @@ async fn main() -> Result<(), anyhow::Error> {

// stop workers. shutdown is not graceful, as the system is expected
// to be capable to handle interuptions and network partitions at any time.
// tasks.shutdown().await;
if tokio::time::timeout(Duration::from_secs(10), tasks.shutdown())
.await
.is_err()
{
// This should never happen. If we fail to abort the task in a reasonable time,
// the process is probably in a weird state and we should let the OS clean it up.
panic!("failed to stop workers in time");
}

// TODO: don't retry in a tight loop, log something
}
Expand Down

0 comments on commit 1487784

Please sign in to comment.