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

feat: api ratelimiter for argoserver #8993

Merged
merged 27 commits into from
Jul 19, 2022

Conversation

tczhao
Copy link
Member

@tczhao tczhao commented Jun 17, 2022

Fixes #7982

tczhao added 13 commits June 16, 2022 13:29
Signed-off-by: Tianchu Zhao <[email protected]>
Signed-off-by: Tianchu Zhao <[email protected]>
Signed-off-by: Tianchu Zhao <[email protected]>
Signed-off-by: Tianchu Zhao <[email protected]>
Signed-off-by: Tianchu Zhao <[email protected]>
Signed-off-by: Tianchu Zhao <[email protected]>
Signed-off-by: Tianchu Zhao <[email protected]>
Signed-off-by: Tianchu Zhao <[email protected]>
Signed-off-by: Tianchu Zhao <[email protected]>
Signed-off-by: Tianchu Zhao <[email protected]>
@tczhao tczhao requested a review from alexec June 18, 2022 00:53
Copy link
Contributor

@alexec alexec left a comment

Choose a reason for hiding this comment

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

This is a non trivial PR. It is also hard to test. My question would be - can we use some off the shelf component?

util/grpc/interceptor.go Outdated Show resolved Hide resolved
Copy link
Contributor

@juliev0 juliev0 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. Added some minor comments.

@juliev0
Copy link
Contributor

juliev0 commented Jun 22, 2022

This is a non trivial PR. It is also hard to test. My question would be - can we use some off the shelf component?

The rate limiting logic itself is being done by a separate gomodule anyway: golang.org/x/time/rate

Signed-off-by: Tianchu Zhao <[email protected]>
Signed-off-by: Tianchu Zhao <[email protected]>
Copy link
Contributor

@alexec alexec left a comment

Choose a reason for hiding this comment

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

I don't think you need to write a lot of this code. Instead you can use this library:

https://github.com/sethvargo/go-limiter

You don't need to write so many tests then.

.github/workflows/ci-build.yaml Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
server/apiserver/argoserver.go Outdated Show resolved Hide resolved
util/apiratelimiter/apiratelimiter.go Outdated Show resolved Hide resolved
util/grpc/interceptor.go Outdated Show resolved Hide resolved
util/apiratelimiter/apiratelimiter.go Outdated Show resolved Hide resolved
util/grpc/interceptor.go Outdated Show resolved Hide resolved
@stale
Copy link

stale bot commented Jul 14, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is a mentoring request, please provide an update here. Thank you for your contributions.

@stale stale bot added the problem/stale This has not had a response in some time label Jul 14, 2022
@stale stale bot removed problem/stale This has not had a response in some time labels Jul 14, 2022
Signed-off-by: Tianchu Zhao <[email protected]>
Signed-off-by: Tianchu Zhao <[email protected]>
Signed-off-by: Tianchu Zhao <[email protected]>
Signed-off-by: Tianchu Zhao <[email protected]>
@tczhao tczhao requested a review from alexec July 15, 2022 17:40
@sarabala1979 sarabala1979 assigned alexec and unassigned sarabala1979 Jul 19, 2022
@alexec alexec merged commit 1af8921 into argoproj:master Jul 19, 2022
reddymh pushed a commit to reddymh/argo-workflows that referenced this pull request Jan 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rate-limit Argo Server API requests
4 participants