Skip to content

Commit

Permalink
Minimise race-conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
BitTheByte committed Sep 18, 2023
1 parent 1990334 commit 244c96d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dask_kubernetes/operator/controller/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 244c96d

Please sign in to comment.