Skip to content

Commit b6b8366

Browse files
committed
osrdyne: address review comment
1 parent 05f1e4b commit b6b8366

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

osrdyne/src/main.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,11 @@ async fn main() -> Result<(), anyhow::Error> {
156156

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

161165
// TODO: don't retry in a tight loop, log something
162166
}

0 commit comments

Comments
 (0)