From 437e2767a8460ef675343c9e9f3e7c21b00de9a6 Mon Sep 17 00:00:00 2001 From: Ada Bohm Date: Fri, 20 Sep 2024 13:32:05 +0200 Subject: [PATCH] Crash counter increased only when worker fails --- crates/tako/src/internal/server/reactor.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/tako/src/internal/server/reactor.rs b/crates/tako/src/internal/server/reactor.rs index 1b7b509e3..9160c1f37 100644 --- a/crates/tako/src/internal/server/reactor.rs +++ b/crates/tako/src/internal/server/reactor.rs @@ -55,7 +55,7 @@ pub(crate) fn on_remove_worker( task.set_fresh_flag(true); ready_to_assign.push(task_id); if task.is_sn_running() { - if task.increment_crash_counter() { + if reason.is_failure() && task.increment_crash_counter() { crashed_tasks.push(task_id); } else { running_tasks.push(task_id);