[RayCluster] Improved the efficiency when checking rayclusters' expectations#4209
Merged
rueian merged 1 commit intoray-project:masterfrom Dec 21, 2025
Merged
Conversation
Contributor
Author
|
@Eikykun Since you implemented the first version of RayClusterScaleExpectation, could you view ? |
c5cedc5 to
cf8f80e
Compare
e9d4859 to
cc80b2e
Compare
Member
There was a problem hiding this comment.
cc @fscnick @machichima @seanlaii for review if you are interested
for more detail, you can refer #2566
ray-operator/controllers/ray/expectations/scale_expectations.go
Outdated
Show resolved
Hide resolved
ray-operator/controllers/ray/expectations/scale_expectations.go
Outdated
Show resolved
Hide resolved
Contributor
|
Thanks for the contribution! Overall LGTM. Once the above comments are addressed, I will approve. |
Collaborator
|
Thanks for the contribution. LGTM. After the comments are resolved, I will approve. |
cc80b2e to
8a2b8a2
Compare
Contributor
Author
Collaborator
|
cc @rueian for final review and re-trigger the CI as the failed CI does not seem to related to this PR's change |
rueian
approved these changes
Dec 21, 2025
JiangJiaWei1103
pushed a commit
to JiangJiaWei1103/kuberay
that referenced
this pull request
Dec 22, 2025
Member
|
cursor review |
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?
The current implementation of
IsSatisfiedinscale_expectation.go, will iterate through all pods in itemsCache. This is not necessary. When one pod fails to meet the expectation, we can return directly.fast-failmeans return earlier once a pod's scaling result is not as expected.Current code:
For example, we may create 10 pods, and expect to successfully get the 10 pods. If none of the pods is ready, no need to iterate through the 10 pods every time. Just find one pod is missing and then break.
I also refactored the code, reduced nested
if-elseconditions.Related issue number
Checks