Skip to content

Commit

Permalink
fix(katana-tasks): ensure is cancelled before waiting on shutdown (#2412
Browse files Browse the repository at this point in the history
)
  • Loading branch information
kariy authored Sep 10, 2024
1 parent dbe8ca8 commit a3727ac
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/katana/tasks/src/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,12 @@ impl TaskManager {
///
/// No task can be spawned on the manager after this method is called.
pub async fn shutdown(self) {
if !self.on_cancel.is_cancelled() {
self.on_cancel.cancel();
}

self.wait_for_shutdown().await;

// need to close the tracker first before waiting
let _ = self.tracker.close();
self.tracker.wait().await;
Expand Down

0 comments on commit a3727ac

Please sign in to comment.