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

Allow switching rate limiter inside RateLimitedQueue #28882

Merged
merged 1 commit into from
Jul 14, 2016

Conversation

gmarek
Copy link
Contributor

@gmarek gmarek commented Jul 13, 2016

Ref. #28832
cc @davidopp

Deprecate deleting-pods-burst ControllerManager flag

@gmarek gmarek added the do-not-merge DEPRECATED. Indicates that a PR should not merge. Label can only be manually applied/removed. label Jul 13, 2016
@gmarek gmarek self-assigned this Jul 13, 2016
@k8s-github-robot k8s-github-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. release-note-label-needed labels Jul 13, 2016
@gmarek gmarek added release-note-none Denotes a PR that doesn't merit a release note. and removed do-not-merge DEPRECATED. Indicates that a PR should not merge. Label can only be manually applied/removed. release-note-label-needed labels Jul 13, 2016
@gmarek gmarek assigned wojtek-t and unassigned gmarek Jul 13, 2016
@gmarek gmarek added this to the v1.4 milestone Jul 13, 2016

// SwapLimiter safely swaps current limiter for this queue with the passed one if capacities or qps's differ.
func (q *RateLimitedTimedQueue) SwapLimiter(limiter flowcontrol.RateLimiter) {
if q.limiter.Capacity() == limiter.Capacity() && q.limiter.QPS() == limiter.QPS() {
Copy link
Member

Choose a reason for hiding this comment

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

This is accessing q.limitted, so also should be done under lock (potentially a different thread can SwapLimitters at the same time.

@k8s-github-robot k8s-github-robot added kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 14, 2016
@gmarek
Copy link
Contributor Author

gmarek commented Jul 14, 2016

@k8s-bot e2e test this issue: #28411

newLimiter = flowcontrol.NewTokenBucketRateLimiter(newQPS, evictionRateLimiterBurst)
}
// If we're currently waiting on limiter, we drain the new one - this is best effort approach.
for q.limiter.Saturation() > newLimiter.Saturation() {
Copy link
Member

Choose a reason for hiding this comment

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

Well, in case of all limitters have Burst=1 it doesn't matter, but I still think that this method of saturation is bad.
Can you please at least add a TODO to consider changing it to be more numer-of-calls-oriented (as I described previously?).

@wojtek-t
Copy link
Member

One comment.

@gmarek
Copy link
Contributor Author

gmarek commented Jul 14, 2016

Done. @wojtek-t PTAL

@gmarek gmarek added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Jul 14, 2016
@wojtek-t wojtek-t added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 14, 2016
@wojtek-t
Copy link
Member

LGTM

@k8s-bot
Copy link

k8s-bot commented Jul 14, 2016

GCE e2e build/test passed for commit f6b1c31.

@k8s-github-robot
Copy link

@k8s-bot test this [submit-queue is verifying that this PR is safe to merge]

@k8s-bot
Copy link

k8s-bot commented Jul 14, 2016

GCE e2e build/test passed for commit f6b1c31.

@k8s-github-robot
Copy link

Automatic merge from submit-queue

@k8s-github-robot k8s-github-robot merged commit 03be711 into kubernetes:master Jul 14, 2016
@gmarek gmarek deleted the ratelimiter branch August 30, 2016 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. 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.

5 participants