-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix #16260: Allow unreachable revisions with initialScale > 1 to scale to 0 #16327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #16260: Allow unreachable revisions with initialScale > 1 to scale to 0 #16327
Conversation
…to scale to 0 Revisions with initialScale > 1 that are no longer referenced by any Route (routingState = 'reserve', mapped to Reachability = Unreachable) were previously unable to scale down to 0, causing resource waste when old revisions were replaced by new ones. This change modifies the initialScale logic in scaler.go to ignore the initialScale constraint when a revision's Reachability is Unreachable. This allows revisions in reserve state to scale down to 0 immediately, freeing up resources promptly when they are no longer needed. The fix adds a check for pa.Spec.Reachability != ReachabilityUnreachable before applying the initialScale constraint, ensuring that: - Revisions with routingState = 'reserve' can scale down to 0 immediately - The initialScale logic only applies to revisions that are still referenced by Routes (routingState = 'active') - Resources are freed promptly when old revisions are replaced A new test case has been added to verify the behavior: revisions with initialScale > 1 and Reachability = Unreachable can now scale to 0. Fixes knative#16260
|
Welcome @aviralgarg05! It looks like this is your first PR to knative/serving 🎉 |
|
Hi @aviralgarg05. Thanks for your PR. I'm waiting for a github.com member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/ok-to-test |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #16327 +/- ##
==========================================
+ Coverage 80.11% 80.14% +0.03%
==========================================
Files 215 216 +1
Lines 13391 13422 +31
==========================================
+ Hits 10728 10757 +29
+ Misses 2304 2298 -6
- Partials 359 367 +8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
/lgtm thanks for the change! |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: aviralgarg05, dprotaso 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 |
Revisions with initialScale > 1 that are no longer referenced by any Route (routingState = 'reserve', mapped to Reachability = Unreachable) were previously unable to scale down to 0, causing resource waste when old revisions were replaced by new ones.
This change modifies the initialScale logic in scaler.go to ignore the initialScale constraint when a revision's Reachability is Unreachable. This allows revisions in reserve state to scale down to 0 immediately, freeing up resources promptly when they are no longer needed.
The fix adds a check for pa.Spec.Reachability != ReachabilityUnreachable before applying the initialScale constraint, ensuring that:
A new test case has been added to verify the behavior: revisions with initialScale > 1 and Reachability = Unreachable can now scale to 0.
Fixes #16260
Proposed Changes
Release Note