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

fix unclosed Thread when create TiSession error (#300) #301

Merged
merged 1 commit into from
Oct 28, 2021

Conversation

ti-srebot
Copy link
Collaborator

@ti-srebot ti-srebot commented Oct 28, 2021

cherry-pick #300 to release-3.1
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/301

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

git push [email protected]:ti-srebot/client-java.git pr/301:release-3.1-489e5c22ec7c

Signed-off-by: marsishandsome [email protected]

What problem does this PR solve?

If the metrics HTTP port is not free, TiSession will leave a unclosed Thread in PDClient.

What is changed and how it works?

put MetricsServer.getInstance at the beginning of this function to avoid unclosed Thread

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Code changes

  • Has exported function/method change
  • Has exported variable/fields change
  • Has interface methods change
  • Has persistent data change

Side effects

  • Possible performance regression
  • Increased code complexity
  • Breaking backward compatibility

Related changes

  • Need to cherry-pick to the release branch
  • Need to update the documentation
  • Need to be included in the release note

@ti-srebot
Copy link
Collaborator Author

/run-all-tests

Copy link
Collaborator

@marsishandsome marsishandsome left a comment

Choose a reason for hiding this comment

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

LGTM

@marsishandsome marsishandsome merged commit db2073d into tikv:release-3.1 Oct 28, 2021
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.

2 participants