Skip to content

Fix deadlock with OrderedReady StatefulSets - #192

Merged
toelke merged 1 commit into
wave-k8s:masterfrom
opaetzelatwork:bugfix/statefulset_deadlock
Sep 7, 2026
Merged

toelke merged 1 commit into
wave-k8s:masterfrom
opaetzelatwork:bugfix/statefulset_deadlock

Conversation

@opaetzelatwork

Copy link
Copy Markdown

Wave's webhook holds back pods with missing ConfigMaps/Secrets by setting spec.template.spec.schedulerName to wave.pusher.com/invalid.

This leads to a deadlock for OrderedReady Statefulsets, because a Pod's schedulerName is immutable. For a Deployment that's invisible, because the template change spawns a new ReplicaSet and the gated pods are scaled away. A StatefulSet has no equivalent supersession. It mutates pods in place through revisions, and pod-0 is already created from the gated revision.

The StatefulSet controller won't proceed past pod-0 until pod-0 is Running and Ready, so it never reaches the rolling-update phase that would replace the stale-revision pod, and never creates pod-1.
pod-0 can never become Ready, because no scheduler will ever claim a pod whose schedulerName names a scheduler that doesn't exist.

This fix deletes the pods of OrderedReady Statefulsets which have no node assigned and the wave schedulerName still in place after the children have appeared.

@opaetzelatwork
opaetzelatwork requested a review from a team as a code owner September 4, 2026 07:08

@toelke toelke left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution! Looks good to me apart from that small thing.

Comment thread charts/wave/Chart.yaml Outdated
@toelke

toelke commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

And for the failing tests: Please rebase onto main now that I merged #193

@toelke

toelke commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

Do you feel comfortable squashing 9caf91f into the other commit and using a rebase instead of a merge? That would make for cleaner history...

- Add option to disable pod deletion
- Move tests for new functionality to e2e tests
- Wait for pod in e2e test instead of sleep 5
@opaetzelatwork
opaetzelatwork force-pushed the bugfix/statefulset_deadlock branch from 9caf91f to 12130a8 Compare September 7, 2026 08:28
@opaetzelatwork

Copy link
Copy Markdown
Author

Squashed everything into one commit.

@toelke

toelke commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the contribution. I will do a release this week.

@toelke
toelke merged commit c2b6437 into wave-k8s:master Sep 7, 2026
6 checks passed
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.

2 participants