-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Limiter extension configgrpc integration draft #12600
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
Conversation
// Limiters are a collection of limiter extensions. Each | ||
// Limitation names an extension that is expected to implement | ||
// limiter.Extension. They are called in order. | ||
Limiters []configlimiter.Limitation `mapreduce:"limiters"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I can see a case with multiple limiters, but it is ok I believe. Maybe in the PR description add a case where you can see multiple limiters being used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confused a bit about limiter vs limit (#12601) but otherwise config/
changes are ok, please update configlimiter
to configlimit
if we go with that.
@@ -478,6 +485,8 @@ func (gss *ServerConfig) getGrpcServerOptions( | |||
var uInterceptors []grpc.UnaryServerInterceptor | |||
var sInterceptors []grpc.StreamServerInterceptor | |||
|
|||
// Initialize the auth extension first. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add in the comment if there is any specific reason.
} | ||
limitExts = append(limitExts, lim) | ||
} | ||
if limitExts != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a best practice to compare len with 0 than the slice with nil.
See #12603 (comment). |
Description
Demonstrates how a
Limiters []limter.Limiter
will be threaded through the gRPC ServerConfig struct, allowing limiters to integrate with gRPC servers easily.Link to tracking issue
Part of #9591.
Testing
TODO
Documentation
TODO