Skip to content

Commit

Permalink
log error first before cancelling
Browse files Browse the repository at this point in the history
  • Loading branch information
kariy committed Sep 11, 2024
1 parent 04b09c1 commit 9e1d9bb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions crates/katana/tasks/src/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ impl TaskManager {
self.on_cancel.cancelled().await;
}

/// Shutdowns the manger and wait until all tasks are finished, either due to completion or
/// cancellation.
/// Shuts down the manager and wait until all currently running tasks are finished, either due
/// to completion or cancellation.
///
/// No task can be spawned on the manager after this method is called.
pub async fn shutdown(self) {
Expand Down
2 changes: 1 addition & 1 deletion crates/katana/tasks/src/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ impl<'a> CriticalTaskBuilder<'a> {
let fut = AssertUnwindSafe(fut)
.catch_unwind()
.map_err(move |error| {
ct.cancel();
let error = PanickedTaskError { error };
error!(%error, task = task_name, "Critical task failed.");
ct.cancel();
error
})
.map(drop);
Expand Down

0 comments on commit 9e1d9bb

Please sign in to comment.