Skip to content

Conversation

@marsishandsome
Copy link
Collaborator

@marsishandsome marsishandsome commented Jul 23, 2021

What problem does this PR solve?

TiSession support graceful close

What is changed and how it works?

Current TiSession.close call ExecutorService.shutdownNow directly.

Add a new function TiSession.closeAwaitTermination:

  1. call ExecutorService.shutdown
  2. check status using ExecutorService.isTerminated, if all terminated return
  3. if timeout, call ExecutorService.shutdown

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

@marsishandsome marsishandsome force-pushed the feature/graceful-close branch from 1bb76ea to a2fa082 Compare July 23, 2021 06:09
Signed-off-by: marsishandsome <marsishandsome@gmail.com>
@marsishandsome marsishandsome force-pushed the feature/graceful-close branch from a2fa082 to 173eeda Compare July 23, 2021 06:36
@marsishandsome marsishandsome changed the title [WIP] TiSession support graceful close TiSession support graceful close Jul 23, 2021
@marsishandsome
Copy link
Collaborator Author

/run-all-tests

Copy link
Collaborator

@birdstorm birdstorm 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 257f306 into tikv:master Jul 28, 2021
ti-srebot pushed a commit to ti-srebot/client-java that referenced this pull request Jul 28, 2021
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Collaborator

cherry pick to release-3.1 in PR #243

marsishandsome added a commit to marsishandsome/client-java that referenced this pull request Jul 28, 2021
Signed-off-by: marsishandsome <marsishandsome@gmail.com>
marsishandsome added a commit that referenced this pull request Jul 28, 2021
Signed-off-by: marsishandsome <marsishandsome@gmail.com>
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