Skip to content
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

Introduce throttler in the activator (do not use it yet) #3082

Merged
merged 6 commits into from
Feb 5, 2019

Conversation

vvraskin
Copy link
Contributor

@vvraskin vvraskin commented Feb 4, 2019

Proposed Changes

This PR doesn't change the existing behaviour of the Activator, rather introduces the throttler which will be integrated in the next PRs. This is the result of splitting #2653

  • Add helper method to generate mock Endpoints for testing.
  • Introduce throttler. The throttler manages the map of Breakers that are updated as new Endpoints get available.
  • Add unit tests for the throttler.
  • Update names.go to get revision name from the service, e.g. remove "-service" suffix.

Release Note

Introduce throttler in the activator.

@knative-prow-robot knative-prow-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Feb 4, 2019
Copy link
Contributor

@knative-prow-robot knative-prow-robot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vvraskin: 2 warnings.

In response to this:

Proposed Changes

This PR doesn't change the existing behaviour of the Activator, rather introduces the throttler which will be integrated in the next PRs. This is the result of splitting #2653

  • Add helper method to generate mock Endpoints for testing.
  • Introduce throttler. The throttler manages the map of Breakers that are updated as new Endpoints get available.
  • Add unit tests for the throttler.
  • Update names.go to get revision name from the service, e.g. remove "-service" suffix.

Release Note

Introduce throttler in the activator.

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/test-infra repository.

Copy link
Contributor

@markusthoemmes markusthoemmes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall! I like the functional approach of passing getter functions to avoid hard-wiring. 🙂

To send feedback early (haven't fully gone through the tests just yet).

The comments mainly propose a restructure of some of the code to make bits and bobs more clear. Shouldn't be a huge deal.

@knative-prow-robot knative-prow-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Feb 5, 2019
Copy link
Contributor

@markusthoemmes markusthoemmes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getting there 👍

@knative-prow-robot knative-prow-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Feb 5, 2019
@vvraskin
Copy link
Contributor Author

vvraskin commented Feb 5, 2019

^^ Unrelated unit test failure

@knative-metrics-robot
Copy link

The following is the coverage report on pkg/.
Say /test pull-knative-serving-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/activator/throttler.go Do not exist 86.9%

Copy link
Contributor

@markusthoemmes markusthoemmes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice, thanks for all the adjustments made 🎉

/lgtm
/approve

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 5, 2019
@markusthoemmes
Copy link
Contributor

/assign @tcnghia

@tcnghia
Copy link
Contributor

tcnghia commented Feb 5, 2019

/approve

@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: markusthoemmes, tcnghia, vvraskin

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 5, 2019
@knative-prow-robot knative-prow-robot merged commit 7a28265 into knative:master Feb 5, 2019
ZhiminXiang pushed a commit to ZhiminXiang/serving-1 that referenced this pull request Feb 7, 2019
* Introduce throttler in activator (do not use it yet)

* Update comments, restructure helper method

* Restructure the creation of the breaker, add more tests for update endpoints, some other refactoring

* Assume revision method is inlined, reshuffle the lock

* Update comments, test appearance

* Inline update capacity error in forceUpdateCapacity
@vvraskin vvraskin deleted the throttler-intro branch February 7, 2019 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants