-
Notifications
You must be signed in to change notification settings - Fork 220
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
kvrpc: deduplicate chained intercept by name #832
Conversation
Signed-off-by: glorv <glorvs@163.com>
Signed-off-by: glorv <glorvs@163.com>
Signed-off-by: glorv <glorvs@163.com>
Signed-off-by: glorv <glorvs@163.com>
Signed-off-by: glorv <glorvs@163.com>
Signed-off-by: glorv <glorvs@163.com>
Signed-off-by: glorv <glorvs@163.com>
@@ -903,6 +903,7 @@ func (s *KVSnapshot) SetRPCInterceptor(it interceptor.RPCInterceptor) { | |||
} | |||
|
|||
// AddRPCInterceptor adds an interceptor, the order of addition is the order of execution. | |||
// the chained interceptors will be dedupcated by its name. |
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.
Why need this?
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.
Currently, the same interceptor is set in different places in tidb, I'm not sure if they are set several times because the current behavior is replace. But I want to change the behavior to add
Signed-off-by: glorv <glorvs@163.com>
@@ -122,29 +153,49 @@ func NewRPCInterceptorChain() *RPCInterceptorChain { | |||
// Link is used to link the next RPCInterceptor. | |||
// Multiple interceptors will be executed in the order of link time. |
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.
add a comment about the behavior of linking duplicated interceptor
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.
done
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.
rest LGTM
Signed-off-by: glorv <glorvs@163.com>
Signed-off-by: glorv <glorvs@163.com>
/merge |
deduplicate chained intercept by name so we can replace SetInterceptor with AddInterceptor