-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 marking activator endpoints populated into sks condition accurately #15279
Fix marking activator endpoints populated into sks condition accurately #15279
Conversation
Welcome @yingyueshi! It looks like this is your first PR to knative/serving 🎉 |
Hi @yingyueshi. Thanks for your PR. I'm waiting for a knative 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. Instructions 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 |
So that means basically we didn't update the mode with serve mode and used only the initial sks one (proxy) thus the problem. Unit test fails because we never checked the sks status field to be false:
|
…activator endpoints and forcing into serve mode (knative#15278)
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: yenniechen The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
I think there is another case not covered:
This will pass by setting:
I see we accept that condition in one similar test: |
You are right. We can see that above Condition (with type name "ActivatorEndpointsPopulated") is used to determine whether the interval for scaling to 0 is reached. If there are no endpoints, is it best not to scale down to 0?
If no activator endpoints, but have revisions endpoints, is it better not scale to Zero while no traffic? If we scale to Zero at that time, maybe we will throw some traffic, for neither activator endpoints nor revision endpoints are added to Public Service. In the case of no activator endpoints and revision endpoints, it is Zero endpoint and no need to scale to Zero any more. Whether marking activator populated or not, it seems no effect. Is it better to mark it or not that just follow the facts that whether activator is really in the path? In addition, I searched the code globally and found that this SKS condition (with type name "ActivatorEndpointsPopulated") is only used to compute grace period of scaling to Zero. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #15279 +/- ##
==========================================
+ Coverage 84.11% 84.78% +0.66%
==========================================
Files 213 218 +5
Lines 16783 13480 -3303
==========================================
- Hits 14117 11429 -2688
+ Misses 2315 1685 -630
- Partials 351 366 +15 ☔ View full report in Codecov by Sentry. |
For the case where TBC != -1 there is logic that will not allow to for the scale down:
if |
I also wonder the answer. |
@dprotaso wdyth? |
@dprotaso gentle ping. |
Yeah I agree |
I think we should update the PR so that we are only marking |
Also thanks for the investigation everyone - it helped me be more informed on the path to take here. |
hey @yenniechen just following up |
So do you have any suggestions? I thought this PR would solve this problem. |
This Pull Request is stale because it has been open for 90 days with |
Fixes #15278
While reconciling SKS, the reconciler will reconcile Public Endpoints and mark Activator Endpoints Populated into Condition at last. If no backends or if we're in the proxy mode, the activator will be considered to back this revision. But in fact, if no activator found, the mode will be forced into "Serve", and not be put in path. Would it be better to exclude this scenario when marking “ActivatorEndpointsPopulated” Condition?
The Condition with type name "ActivatorEndpointsPopulated" in SKS status is used to determine whether the interval for scaling to 0 is reached. If there are no endpoints, is it best not to scale down to 0?
Release Note