From a44dca4571425e321bce3ee081b61bf89ba54879 Mon Sep 17 00:00:00 2001 From: fjetter Date: Fri, 20 May 2022 11:40:18 +0200 Subject: [PATCH] Only increase suspicious counter for executing tasks --- distributed/scheduler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/distributed/scheduler.py b/distributed/scheduler.py index c47f953c6a6..e146f0b3f7b 100644 --- a/distributed/scheduler.py +++ b/distributed/scheduler.py @@ -4240,10 +4240,10 @@ async def remove_worker(self, address, stimulus_id, safe=False, close=True): recommendations: dict = {} ts: TaskState - for ts in list(ws.processing): + for ts in ws.processing: k = ts.key recommendations[k] = "released" - if not safe: + if not safe and ts in ws.executing: ts.suspicious += 1 ts.prefix.suspicious += 1 if ts.suspicious > self.allowed_failures: