-
Notifications
You must be signed in to change notification settings - Fork 719
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
client: fix the pd client could be blocked in some cases #3283
Conversation
Signed-off-by: leoppro <zhaoyilin@pingcap.com>
a7b400d
to
515b4a2
Compare
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, could you benchmark the change withtools/pd-tso-bench
?
e677e48
to
639ab0e
Compare
Codecov Report
@@ Coverage Diff @@
## master #3283 +/- ##
==========================================
+ Coverage 73.95% 74.17% +0.22%
==========================================
Files 243 243
Lines 23071 23074 +3
==========================================
+ Hits 17062 17116 +54
+ Misses 4425 4392 -33
+ Partials 1584 1566 -18
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
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
/label need-cherry-pick-4.0 |
These labels are not found |
@leoppro Could you please bring this change to |
/label needs-cherry-pick-4.0 |
ok |
/merge |
@leoppro: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the tidb-community-bots/ti-community-prow repository. |
@leoppro: you cannot merge your own PR. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the tidb-community-bots/ti-community-prow repository. |
/merge |
@lhy1024: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the tidb-community-bots/ti-community-prow repository. |
@leoppro: Your PR has out-of-dated and I have automatically updated it for you. /run-all-tests Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the tidb-community-bots/ti-community-prow repository. |
/merge cancel |
It is may not appropriate to use multiple |
I think when |
I don't agree with you. Let's think about this following cases:
this case is exist in tikv client: here we call GetTSO using backend context: https://github.com/pingcap/tidb/blob/master/store/tikv/kv.go#L387 |
I found a similar double |
/merge |
@HunDunDM: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the tidb-community-bots/ti-community-prow repository. |
Can merge label has been added. Git tree hash: 9bdc111
|
/run-integration-common-test |
1 similar comment
/run-integration-common-test |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-4.0 in PR #3285 |
* cherry pick #3283 to release-4.0 Signed-off-by: ti-srebot <ti-srebot@pingcap.com> * fmt Signed-off-by: leoppro <zhaoyilin@pingcap.com> Co-authored-by: leoppro <i@leop.pro> Co-authored-by: Ti Prow Robot <71242396+ti-community-prow-bot@users.noreply.github.com>
Signed-off-by: leoppro zhaoyilin@pingcap.com
What problem does this PR solve?
Fix the PD client could be blocked in some cases
What is changed and how it works?
There are two levels of context in PD client:
client context
andtso request context
.the
tsoRequest.Wait()
function could be blocked when theclient context
is canceled because theWait()
function haven't listened theclient context
Benchmark
the version of PD server: v4.0.8
before this PR:
after this PR:
Check List
Tests
Release note