[release-0.17] MultiKueue: prevent a hung remote watch from stopping all-cluster admission#11298
Merged
k8s-ci-robot merged 4 commits intoMay 18, 2026
Conversation
A hung client.Watch() against one remote MultiKueueCluster previously blocked the single multikueuecluster reconciler worker indefinitely, preventing every other cluster behind it from being reconciled. Those clusters keep remoteClient.connecting=true, the dispatcher then excludes them as inactive, and admission stops cluster-wide. Wrap the Watch establishment in a timeout-bounded helper. On timeout the in-flight Watch is canceled and an error is returned, so the existing failedConnAttempts / retryAfter backoff runs. Stream lifetime on the success path is unchanged: the returned watcher continues to use a context derived from the caller's ctx, and its cancel is owned by the watcher Stop method (no leak). Signed-off-by: Tri Lam <tree@lumalabs.ai>
Address review feedback: refactor the three subtests into a map-keyed table following the codebase's prevailing test style. Behaviour is unchanged; the per-case interceptor, expected error (matched via errors.Is), and elapsed-time ceiling are uniform. Signed-off-by: Tri Lam <trilamsr@gmail.com>
If c.Watch returns a non-nil watcher in the narrow window between time.After firing and the result-channel drain, the previous code discarded the watcher without calling Stop(). In production the watcher's HTTP stream is bound to establishCtx so cancel() tears it down indirectly, but fake clients used in tests ignore ctx and the watcher would leak. Drain the channel into a local and Stop() any returned watcher. Add a regression test using a sleeping interceptor and watch.NewFake() to assert Stop() was called. Signed-off-by: Tri Lam <trilamsr@gmail.com>
60s would false-trip during apiserver watch-cache cold-start when the served version differs from the storage version and a conversion webhook is in play (kubernetes/kubernetes#136950, observed ~8 min at ~50k Workloads in Kueue 0.15). Expand the constant's doc comment to capture the rationale so future readers don't tighten the bound without understanding the cold-start path.
✅ Deploy Preview for kubernetes-sigs-kueue ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
|
/kind bug |
Contributor
|
LGTM label has been added. DetailsGit tree hash: c1ff1ece2b6c2d88b9be8b7c0825650d7b09195e |
Contributor
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: k8s-infra-cherrypick-robot, mimowo The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Contributor
|
Clearing the release note as we will have a combined release note in the follow up PR: #11304 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is an automated cherry-pick of #11207
/assign mimowo