Skip to content

fix(scheduler): keep succeeded pods visible so completing gangs are not evicted - #2022

Merged
enoodle merged 4 commits into
v0.17from
backport-2012-to-v0.17
Aug 6, 2026
Merged

fix(scheduler): keep succeeded pods visible so completing gangs are not evicted#2022
enoodle merged 4 commits into
v0.17from
backport-2012-to-v0.17

Conversation

@KaiPilotBot

Copy link
Copy Markdown
Collaborator

Description

Backport of #2012 to v0.17.

…ot evicted

The pod informer filtered both Succeeded and Failed pods at watch time, so
PodGroupInfo.IsStale never saw the Succeeded pods its guard relies on. A gang
whose pods complete one by one was therefore judged stale, and stalegangeviction
evicted the remaining running pods after the grace period.

Filter only Failed pods at watch time and keep Succeeded visible, while leaving
isTerminated (the Evict guard) treating both phases as terminal.

Signed-off-by: Thezone-1 <somoprovobhattacharjee@gmail.com>
(cherry picked from commit d0ef5e2)
… reads

Succeeded pods are now watched, so the scheduler cache retains pod objects it
previously dropped. A succeeded pod is excluded from every status group in
pod_status, so it never reaches NodeInfo.AddTask and none of its spec is read.

Transform succeeded pods to an allowlist of name, namespace, UID, phase, the
podgroup annotation, and the subgroup and app labels. The phase drives
getTaskStatus, the annotation and subgroup label drive PodGroupInfo.AddTaskInfo,
and the app label keeps IsResourceReservationTask classifying correctly.

Signed-off-by: Thezone-1 <somoprovobhattacharjee@gmail.com>
(cherry picked from commit a09ac61)
The app label is only read by IsResourceReservationTask and IsScaleAdjustTask.
Neither runs for a succeeded pod: node accounting and the proportion plugin both
gate on IsActiveUsedStatus, which excludes Succeeded. The remaining caller, the
reservation split in getNodeToPodInfosMap, would route the pod into
nodeReservationPodInfosMap under an empty node name, which nothing drains, so
retaining the label dropped succeeded reservation pods from the snapshot.

Also drops the second changelog fragment and fixes map alignment in the test.

Signed-off-by: Thezone-1 <somoprovobhattacharjee@gmail.com>
(cherry picked from commit b06e3db)
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: b9df0cc6-ed89-4a03-a781-a43e28d3b0b3

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@enoodle
enoodle enabled auto-merge (squash) August 6, 2026 12:37
@enoodle
enoodle merged commit 3767c11 into v0.17 Aug 6, 2026
15 checks passed
@enoodle
enoodle deleted the backport-2012-to-v0.17 branch August 6, 2026 13:09
@KaiPilotBot

Copy link
Copy Markdown
Collaborator Author

📝 Changelog fragment recorded

Thanks! This PR added the changelog fragment(s) below. Pending fragments are folded into CHANGELOG.md at release time, so it was intentionally not modified by this PR — your entry will appear in the next release:

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.

3 participants