-
Notifications
You must be signed in to change notification settings - Fork 724
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
grpc: add caller info to client and wrap innerClient #8704
Conversation
Signed-off-by: okJiang <[email protected]>
Skipping CI for Draft Pull Request. |
…or-grpc Signed-off-by: okJiang <[email protected]>
/retest |
Signed-off-by: okJiang <[email protected]>
Signed-off-by: okJiang <[email protected]>
Signed-off-by: okJiang <[email protected]>
/retest |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #8704 +/- ##
==========================================
- Coverage 75.24% 75.16% -0.08%
==========================================
Files 456 458 +2
Lines 71608 71681 +73
==========================================
- Hits 53884 53882 -2
- Misses 14295 14356 +61
- Partials 3429 3443 +14
Flags with carried forward coverage won't be shown. Click here to find out more.
|
…or-grpc Signed-off-by: okJiang <[email protected]>
Signed-off-by: okJiang <[email protected]>
Signed-off-by: okJiang <[email protected]>
Signed-off-by: okJiang <[email protected]>
Signed-off-by: okJiang <[email protected]>
Signed-off-by: okJiang <[email protected]>
/retest |
/cc @JmPotato |
wg sync.WaitGroup | ||
tlsCfg *tls.Config | ||
option *option | ||
inner *innerClient |
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.
A nested struct without introducing the field inner
may reduce the code changes. But I'm not sure whether the pointer here still works, maybe we can have a try.
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.
But I'm not sure whether the pointer here still works, maybe we can have a try.
I tried it before and indeed encountered some issues, so I wrapped the inner client.
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.
And I think wrapping innerclient
also helps to reduce the amount of code in client.go, as the code lines in client.go are a bit excessive.
Signed-off-by: okJiang <[email protected]>
…llerid-for-grpc Signed-off-by: okJiang <[email protected]>
Signed-off-by: okJiang <[email protected]>
Signed-off-by: okJiang <[email protected]>
/retest |
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.
lgtm
// adjustCallerComponent returns the caller component if it is empty, it | ||
// is the upper layer of the pd client. | ||
func adjustCallerComponent(callerComponent caller.Component) caller.Component { | ||
if len(callerComponent) != 0 { |
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.
Better trim it first before the check.
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.
Trim space? de83c86
Signed-off-by: okJiang <[email protected]>
…or-grpc Signed-off-by: okJiang <[email protected]>
Signed-off-by: okJiang <[email protected]>
Signed-off-by: okJiang <[email protected]>
/retest |
1 similar comment
/retest |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: JmPotato, nolouch The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest |
1 similar comment
/retest |
What problem does this PR solve?
Issue Number: Ref #8593
What is changed and how does it work?
Check List
Tests
Release note