diff --git a/tokio-console/src/warnings.rs b/tokio-console/src/warnings.rs index 59d43f99f..f6c56b4bf 100644 --- a/tokio-console/src/warnings.rs +++ b/tokio-console/src/warnings.rs @@ -148,6 +148,10 @@ impl Warn for SelfWakePercent { } fn check(&self, task: &Task) -> Warning { + // Don't fire warning for tasks that are not async + if task.kind() == "block_on" || task.kind() == "blocking" { + return Warning::Ok + } let self_wakes = task.self_wake_percent(); if self_wakes > self.min_percent { Warning::Warn @@ -174,6 +178,10 @@ impl Warn for LostWaker { } fn check(&self, task: &Task) -> Warning { + // Don't fire warning for tasks that are not async + if task.kind() == "block_on" || task.kind() == "blocking" { + return Warning::Ok + } if !task.is_completed() && task.waker_count() == 0 && !task.is_running() @@ -222,6 +230,10 @@ impl Warn for NeverYielded { } fn check(&self, task: &Task) -> Warning { + // Don't fire warning for tasks that are not async + if task.kind() == "block_on" || task.kind() == "blocking" { + return Warning::Ok + } // Don't fire warning for tasks that are waiting to run if task.state() != TaskState::Running { return Warning::Ok;