[ray-operator] CalculateMinResources should respect workerGroupSpec.Suspend#4958
Merged
andrewsykim merged 1 commit intoJun 26, 2026
Conversation
…uspend CalculateMinResources summed the minimum resources of every worker group, including suspended ones, while its siblings (CalculateMinReplicas, CalculateMaxReplicas, CalculateDesiredResources) skip suspended groups. Because the Volcano scheduler derives a PodGroup's MinMember from CalculateMinReplicas and its MinResources from CalculateMinResources, a suspended worker group with MinReplicas > 0 made MinResources reserve pods that MinMember does not account for, an inconsistent gang-scheduling reservation that the MinMember pods can never satisfy. Skip suspended worker groups, matching the sibling functions. Signed-off-by: Aditya Aggarwal <42476079+aditya-786@users.noreply.github.com>
aditya-786
requested review from
MortalHappiness,
andrewsykim,
kevin85421 and
rueian
as code owners
June 26, 2026 15:31
andrewsykim
approved these changes
Jun 26, 2026
| headPodResource := CalculatePodResource(cluster.Spec.HeadGroupSpec.Template.Spec) | ||
| minResourcesList = append(minResourcesList, headPodResource) | ||
| for _, nodeGroup := range cluster.Spec.WorkerGroupSpecs { | ||
| if nodeGroup.Suspend != nil && *nodeGroup.Suspend { |
Member
There was a problem hiding this comment.
I had added the same change in #4953 and was contemplating if it should be in a separate PR. Thanks for opening
troy0820
pushed a commit
to troy0820/kuberay
that referenced
this pull request
Jul 13, 2026
…uspend (ray-project#4958) CalculateMinResources summed the minimum resources of every worker group, including suspended ones, while its siblings (CalculateMinReplicas, CalculateMaxReplicas, CalculateDesiredResources) skip suspended groups. Because the Volcano scheduler derives a PodGroup's MinMember from CalculateMinReplicas and its MinResources from CalculateMinResources, a suspended worker group with MinReplicas > 0 made MinResources reserve pods that MinMember does not account for, an inconsistent gang-scheduling reservation that the MinMember pods can never satisfy. Skip suspended worker groups, matching the sibling functions. Signed-off-by: Aditya Aggarwal <42476079+aditya-786@users.noreply.github.com>
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.
Why are these changes needed?
CalculateMinResourcessums the minimum resources of every worker group, including suspended ones, while its sibling functions —CalculateMinReplicas,CalculateMaxReplicas, andCalculateDesiredResources— all skip worker groups withSuspend: true. TheSuspendguard was added to those siblings in #2728, butCalculateMinResourceswas missed.The Volcano scheduler derives a
PodGroup'sMinMemberfromCalculateMinReplicasand itsMinResourcesfromCalculateMinResources(batchscheduler/volcano/volcano_scheduler.go). So a suspended worker group withMinReplicas > 0makesMinResourcesreserve resources for pods thatMinMemberdoes not count — an internally inconsistent gang-scheduling reservation that theMinMemberpods can never satisfy.This adds the same
Suspendguard the sibling functions already use, so suspended worker groups are excluded from the minimum-resource total. The existingTestCalculateResources"Head pod with suspended worker group" case usesminReplicas: 0(so its loop adds nothing and cannot detect the bug); a new case withminReplicas > 0fails before this change and passes after.Related issue number
Follow-up to #2728, which added the
Suspendguard to the sibling functions.Checks