Skip to content

Keep DaskCluster in the Created phase until all components exist - #977

Open
bnaul wants to merge 2 commits into
dask:mainfrom
replicahq:claude/dask-autoscaler-race-condition-8xi2ox
Open

Keep DaskCluster in the Created phase until all components exist#977
bnaul wants to merge 2 commits into
dask:mainfrom
replicahq:claude/dask-autoscaler-race-condition-8xi2ox

Conversation

@bnaul

@bnaul bnaul commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Closes #976.

daskcluster_create_components only matches while status.phase == "Created". If it fails once and handle_scheduler_service_status moves the phase to Running before the retry runs, kopf drops the retry and the default DaskWorkerGroup is never created.

  • handle_scheduler_service_status no longer changes the phase while the cluster is still Created.
  • daskcluster_create_components sets the phase itself once all components exist (Running, or Pending for a LoadBalancer service without ingress) instead of always writing Pending. This also stops Pending from overwriting Running (DaskCluster stuck in Pending state - Possible race condition? #968).
  • Adds a unit test for the new guard.

daskcluster_create_components is a kopf field handler that only matches
while status.phase == "Created". If it fails once and
handle_scheduler_service_status moves the phase to Running before the
retry runs, kopf drops the retry and the default DaskWorkerGroup is
never created.

Leave the phase alone in handle_scheduler_service_status while the
cluster is Created, and let daskcluster_create_components set the final
phase from the scheduler Service state once every component exists. This
also stops Pending from overwriting an earlier Running.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SDXhtGmuPdnM98aP4HnxQE
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Default DaskWorkerGroup is never created if daskcluster_create_components fails once

1 participant