diff --git a/distributed/scheduler.py b/distributed/scheduler.py index 7069a69349b..6cb27623abb 100644 --- a/distributed/scheduler.py +++ b/distributed/scheduler.py @@ -5458,6 +5458,10 @@ def handle_worker_status_change(self, status: str, worker: str) -> None: if not ws: return prev_status = ws._status + ws._status = Status.lookup[status] # type: ignore + if ws._status == prev_status: + return + self.log_event( ws._address, { @@ -5466,9 +5470,6 @@ def handle_worker_status_change(self, status: str, worker: str) -> None: "status": status, }, ) - ws._status = Status.lookup[status] # type: ignore - if ws._status == prev_status: - return if ws._status == Status.running: parent._running.add(ws)