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

All clients under ClientSet share one RateLimiter. #24166

Merged
merged 1 commit into from
Apr 22, 2016

Conversation

gmarek
Copy link
Contributor

@gmarek gmarek commented Apr 12, 2016

Currently we create a rate limiter for each client in client set. It makes the reasoning about rate limiting behavior much harder. This PR changes this behavior and now all clients in the set share single rate limiter. Ref. #24157

cc @lavalamp @wojtek-t

@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 Apr 12, 2016
@@ -87,6 +88,9 @@ type Config struct {

// Maximum burst for throttle
Burst int

// Rate limiter for limiting connections to the master from this client. If present overwrites QPS/Burst
Copy link
Member

Choose a reason for hiding this comment

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

What prevents replacing QPS/Burst?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nothing hard - I'm just following the 'add, don't remove' principle in case it was used somewhere in a serialized form. I can remove them if you believe it's safe.

@k8s-bot
Copy link

k8s-bot commented Apr 12, 2016

GCE e2e build/test failed for commit 1138a8046449f3fac643d3d3f696b476bf239a58.

Please reference the list of currently known flakes when examining this failure. If you request a re-test, you must reference the issue describing the flake.

@gmarek
Copy link
Contributor Author

gmarek commented Apr 12, 2016

If this think looks valid I'll fix tests tomorrow.

if c.RateLimiter == nil && c.QPS > 0 {
c.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(c.QPS, c.Burst)
}
var clientset Clientset
Copy link
Member

Choose a reason for hiding this comment

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

the indentation in lines you added look strange - please fix

@k8s-bot
Copy link

k8s-bot commented Apr 13, 2016

GCE e2e build/test passed for commit e2727f31dbd7b4df413463a1c53fdc1185e613ad.

@gmarek
Copy link
Contributor Author

gmarek commented Apr 14, 2016

@krousey PTAL, @lavalamp - should I remove QPS/Burst from the Config?

if c.RateLimiter == nil && c.QPS > 0 {
c.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(c.QPS, c.Burst)
}
var clientset Clientset
Copy link
Member

Choose a reason for hiding this comment

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

It seems we are using "\t" in all other places in this file. Can you please change it to it here too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@gmarek gmarek force-pushed the client branch 2 times, most recently from 31ed3f8 to a95bbd9 Compare April 14, 2016 15:12
@k8s-bot
Copy link

k8s-bot commented Apr 14, 2016

GCE e2e build/test passed for commit 31ed3f8c7528b99cae55b2d060be0fc09a6eee84.

@k8s-bot
Copy link

k8s-bot commented Apr 14, 2016

GCE e2e build/test passed for commit a95bbd9657d49a319e49859f8fe0117b7ce76f85.

@gmarek
Copy link
Contributor Author

gmarek commented Apr 18, 2016

ping @krousey
@lavalamp - can you take a look or reassign if @krousey don't have time?

if c.RateLimiter == nil && c.QPS > 0 {
c.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(c.QPS, c.Burst)
}
var clientset Clientset
Copy link
Contributor

Choose a reason for hiding this comment

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

This indentation is off.

@k8s-bot
Copy link

k8s-bot commented Apr 20, 2016

GCE e2e build/test failed for commit 78ea2b80f7cd216504d292f335a80606caa3c469.

Please reference the list of currently known flakes when examining this failure. If you request a re-test, you must reference the issue describing the flake.

@gmarek
Copy link
Contributor Author

gmarek commented Apr 20, 2016

Applied your comments. @krousey PTAL

@gmarek
Copy link
Contributor Author

gmarek commented Apr 20, 2016

Does this need a release note? @lavalamp @krousey

@k8s-bot
Copy link

k8s-bot commented Apr 20, 2016

GCE e2e build/test failed for commit 45ad00f24e6eb29ae1674d8d0638e8ca74eedd92.

Please reference the list of currently known flakes when examining this failure. If you request a re-test, you must reference the issue describing the flake.

@krousey
Copy link
Contributor

krousey commented Apr 20, 2016

@gmarek I would think so. This is definitely going to affect ALL controllers. They will now share a single rate limiter.

https://github.com/kubernetes/kubernetes/blob/master/cmd/kube-controller-manager/app/controllermanager.go#L194

@gmarek
Copy link
Contributor Author

gmarek commented Apr 20, 2016

@k8s-bot test this issue: #22719

@k8s-bot
Copy link

k8s-bot commented Apr 20, 2016

GCE e2e build/test passed for commit 45ad00f24e6eb29ae1674d8d0638e8ca74eedd92.

@gmarek gmarek changed the title Add RateLimiter to RESTConfig and create RateLimiter to be shared in … All clients under ClientSet share one RateLimiter. Apr 21, 2016
@gmarek gmarek added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-label-needed labels Apr 21, 2016
@gmarek
Copy link
Contributor Author

gmarek commented Apr 21, 2016

@krousey - Renamed PR into a release-note friendly form. PTAL

@krousey krousey added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 21, 2016
@k8s-bot
Copy link

k8s-bot commented Apr 21, 2016

GCE e2e build/test passed for commit b76bed0.

@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 Apr 22, 2016

GCE e2e build/test passed for commit b76bed0.

@k8s-github-robot
Copy link

Automatic merge from submit-queue

@k8s-github-robot k8s-github-robot merged commit 495251b into kubernetes:master Apr 22, 2016
@gmarek gmarek deleted the client branch August 30, 2016 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants