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

[close #635] constraint the getMember timeout by inject a backoffer (#636) #637

Merged
merged 1 commit into from
Jul 29, 2022

Conversation

ti-srebot
Copy link
Collaborator

@ti-srebot ti-srebot commented Jul 27, 2022

cherry-pick #636 to release-3.3
You can switch your code base to this Pull Request by using git-extras:

# In client-java repo:
git pr https://github.com/tikv/client-java/pull/637

After apply modifications, you can push your change to this PR via:

git push git@github.com:ti-srebot/client-java.git pr/637:release-3.3-3128161b1f04

Signed-off-by: iosmanthus myosmanthustree@gmail.com

What problem does this PR solve?

Issue Number: close #635

Problem Description:

The getMembers is not limited by a backoffer, which might cause the exception will not throw in time. For example, a user might set the timeout of a request to 400ms, but if the PD is disconnected, the getMembers might sleep more than 400ms since the backoffer it used is not passed from the upper code.

What is changed and how does it work?

Inject a backoffer for getMembers and check timeout before acquiring a channel from the pool.

Check List for Tests

This PR has been tested by at least one of the following methods:

  • Unit test

Related changes

  • Need to cherry-pick the release branch

Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Collaborator Author

/run-all-tests

@codecov
Copy link

codecov bot commented Jul 27, 2022

Codecov Report

❗ No coverage uploaded for pull request base (release-3.3@52491a1). Click here to learn what that means.
The diff coverage is n/a.

@@              Coverage Diff               @@
##             release-3.3     #637   +/-   ##
==============================================
  Coverage               ?   34.92%           
  Complexity             ?     1432           
==============================================
  Files                  ?      278           
  Lines                  ?    17361           
  Branches               ?     1974           
==============================================
  Hits                   ?     6063           
  Misses                 ?    10686           
  Partials               ?      612           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 52491a1...6dac458. Read the comment docs.

@iosmanthus
Copy link
Member

LGTM

@ti-srebot
Copy link
Collaborator Author

@zhangyangyu, Thanks for your review. The bot only counts LGTMs from Reviewers and higher roles, but you're still welcome to leave your comments. You are not a reviewer or committer or co-leader or leader.

@iosmanthus iosmanthus merged commit 6e8c0fc into tikv:release-3.3 Jul 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants