From 4cee047ebc256df44a46321d36fe3f1c67adb887 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Fri, 24 Oct 2025 19:32:41 +0000 Subject: [PATCH] fix agent worker nits --- backend/windmill-worker/src/worker.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/backend/windmill-worker/src/worker.rs b/backend/windmill-worker/src/worker.rs index 5fe2ffac68..281e38c626 100644 --- a/backend/windmill-worker/src/worker.rs +++ b/backend/windmill-worker/src/worker.rs @@ -1542,13 +1542,15 @@ pub async fn run_worker( Ok(_) | Err(broadcast::error::TryRecvError::Closed) => true, _ => false, } { - if !killed_but_draining_same_worker_jobs && job_completed_tx.is_sql() { + if !killed_but_draining_same_worker_jobs { killed_but_draining_same_worker_jobs = true; - tracing::info!(worker = %worker_name, hostname = %hostname, "killpill received in worker main loop, sending killpill job"); - job_completed_tx - .kill() - .await - .expect("send kill to job completed tx"); + if job_completed_tx.is_sql() { + tracing::info!(worker = %worker_name, hostname = %hostname, "killpill received in worker main loop, sending killpill job"); + job_completed_tx + .kill() + .await + .expect("send kill to job completed tx"); + } } continue; } else if killed_but_draining_same_worker_jobs {