Repository navigation
fix(scheduler): keep PodScheduled in cached pods (cherry-pick for v0.18.6-meshy.2) - #4
Merged
liuxu623 merged 1 commit intoNov 3, 2026
Conversation
…ons are not re-patched The pod informer transform kept only PodResizePending, so the status updater, which compares the new condition with the cached pod, never found PodScheduled and patched every pending pod's condition on every cycle, with a fresh lastTransitionTime. Keep PodScheduled too: the condition is then patched only when its status, reason or message changes. Fixes kai-scheduler#2544 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Sam Huang <19882250+sam-huang1223@users.noreply.github.com> (cherry picked from commit 4cf15ba)
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.
Summary
Cherry-picks the upstream change from kai-scheduler#2545 (upstream issue kai-scheduler#2544) onto our v0.18.6 build branch, on top of the pod-level resources commit that
v0.18.6-meshy.1ships.The scheduler's pod informer transform (
compactConditions) kept onlyPodResizePending, so the status updater never foundPodScheduledin the cached pod and patched every pending pod's condition on every cycle with a freshlastTransitionTime. This change keepsPodScheduledin the cache, so the condition is patched only when its status, reason or message changes.Why we need it now
On xinjiang the API server is reached over a 100 Mbps public link. With ~55 pending pods the scheduler produced ~1300 pod updates per minute (only
lastTransitionTimechanged), which fanned out to every cluster-wide pod watcher as ~11 MB/s of watch traffic and saturated the link. pod-grouper API calls then took ~5s each, its queue sat at ~95 pods, and new pods waited minutes for a PodGroup.Plan
v0.18.6-meshy.2, build only theschedulerimage (podgroupcontroller stays onmeshy.1).Testing
-xtrailer).go test ./pkg/scheduler/cache/...passes, includingstatus_updaterand the new "keeps PodScheduled" spec.🤖 Generated with Claude Code
Note
Low Risk
Narrow change to scheduler cache compaction with a targeted test; reduces API traffic without altering scheduling decisions.
Overview
Fixes excessive pod status patches for pending workloads by changing
compactConditionsin the scheduler informer transform: it now keeps bothPodResizePendingandPodScheduledin the cached pod copy, instead of retaining only resize-pending (and dropping scheduled state).With
PodScheduledpresent in cache, the status updater can compare the existing condition before patching, so unschedulable pending pods are not re-patched every scheduling cycle when onlylastTransitionTimewould change. That cuts API churn and watch traffic on clusters with many pending pods.Adds a
compactSchedulerPodtest asserting both condition types survive compaction, plus an unreleased changelog entry for issue 2544.Reviewed by Cursor Bugbot for commit 87311e8. Bugbot is set up for automated code reviews on this repo. Configure here.