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

grpc: add caller info to client and wrap innerClient #8704

Merged
merged 31 commits into from
Nov 20, 2024

Conversation

okJiang
Copy link
Member

@okJiang okJiang commented Oct 15, 2024

What problem does this PR solve?

Issue Number: Ref #8593

What is changed and how does it work?

Check List

Tests

  • Unit test
  • Integration test

Release note

None.

Copy link
Contributor

ti-chi-bot bot commented Oct 15, 2024

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. dco-signoff: yes Indicates the PR's author has signed the dco. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Oct 15, 2024
@okJiang
Copy link
Member Author

okJiang commented Oct 18, 2024

/retest

Signed-off-by: okJiang <[email protected]>
Signed-off-by: okJiang <[email protected]>
Signed-off-by: okJiang <[email protected]>
@okJiang
Copy link
Member Author

okJiang commented Oct 18, 2024

/retest

Copy link

codecov bot commented Oct 18, 2024

Codecov Report

Attention: Patch coverage is 85.49383% with 47 lines in your changes missing coverage. Please review.

Project coverage is 75.16%. Comparing base (76e3b43) to head (dadf547).
Report is 2 commits behind head on master.

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     
Flag Coverage Δ
unittests 75.16% <85.49%> (-0.08%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

---- 🚨 Try these New Features:

@ti-chi-bot ti-chi-bot bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 25, 2024
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]>
@okJiang
Copy link
Member Author

okJiang commented Nov 6, 2024

/retest

@okJiang okJiang marked this pull request as ready for review November 6, 2024 08:56
@okJiang okJiang changed the title [WIP] grpc: add caller info and wrap innerClient grpc: add caller info and wrap innerClient Nov 6, 2024
@ti-chi-bot ti-chi-bot bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 6, 2024
@okJiang
Copy link
Member Author

okJiang commented Nov 6, 2024

/cc @JmPotato

@ti-chi-bot ti-chi-bot bot requested a review from JmPotato November 6, 2024 08:57
client/caller/constant.go Outdated Show resolved Hide resolved
client/caller/constant.go Outdated Show resolved Hide resolved
client/client.go Outdated Show resolved Hide resolved
wg sync.WaitGroup
tlsCfg *tls.Config
option *option
inner *innerClient
Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member Author

@okJiang okJiang Nov 8, 2024

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]>
@okJiang
Copy link
Member Author

okJiang commented Nov 14, 2024

ptal @JmPotato @nolouch

The conflicts are too much... Let me fix them after your approve😭

Signed-off-by: okJiang <[email protected]>
Signed-off-by: okJiang <[email protected]>
@okJiang
Copy link
Member Author

okJiang commented Nov 18, 2024

/retest

@okJiang
Copy link
Member Author

okJiang commented Nov 19, 2024

/cc @JmPotato @nolouch

Copy link
Contributor

@nolouch nolouch left a comment

Choose a reason for hiding this comment

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

lgtm

@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Nov 19, 2024
// 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 {
Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

Trim space? de83c86

@okJiang
Copy link
Member Author

okJiang commented Nov 20, 2024

/retest

1 similar comment
@okJiang
Copy link
Member Author

okJiang commented Nov 20, 2024

/retest

@ti-chi-bot ti-chi-bot bot added the lgtm label Nov 20, 2024
Copy link
Contributor

ti-chi-bot bot commented Nov 20, 2024

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot removed the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Nov 20, 2024
Copy link
Contributor

ti-chi-bot bot commented Nov 20, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-11-19 07:29:19.893868182 +0000 UTC m=+946122.084737171: ☑️ agreed by nolouch.
  • 2024-11-20 13:30:41.962450058 +0000 UTC m=+38429.582104573: ☑️ agreed by JmPotato.

@okJiang
Copy link
Member Author

okJiang commented Nov 20, 2024

/retest

1 similar comment
@okJiang
Copy link
Member Author

okJiang commented Nov 20, 2024

/retest

@ti-chi-bot ti-chi-bot bot merged commit 0da1b11 into tikv:master Nov 20, 2024
25 checks passed
@okJiang okJiang deleted the introduce-callerid-for-grpc branch November 21, 2024 07:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved dco-signoff: yes Indicates the PR's author has signed the dco. lgtm release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants