diff --git a/dask_kubernetes/operator/controller/controller.py b/dask_kubernetes/operator/controller/controller.py index e798f8edb..68e00d2fb 100644 --- a/dask_kubernetes/operator/controller/controller.py +++ b/dask_kubernetes/operator/controller/controller.py @@ -599,12 +599,14 @@ async def daskworkergroup_replica_update( for worker in current_workers: if len(pending_workers) >= -workers_needed: break - if await worker.ready(): + if not await worker.ready(): pending_workers.append(worker) if pending_workers: logger.info(f"Pending worker deployments to delete: {pending_workers}") for worker in pending_workers: + if await worker.ready(): + continue await worker.delete() n_workers = -workers_needed - len(pending_workers)