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 a bug that MPP tasks may leak threads forever #4241

Merged
merged 8 commits into from
Mar 15, 2022
Merged

Fix a bug that MPP tasks may leak threads forever #4241

merged 8 commits into from
Mar 15, 2022

Conversation

bestwoody
Copy link
Contributor

@bestwoody bestwoody commented Mar 14, 2022

What problem does this PR solve?

Issue Number: close #4238

Problem Summary:

What is changed and how it works?

MppTunnel and its consumer will be closed as expected when MppTunnel received cancel request before consumer connects it.
So need throw a exception like connected to let consumer finish when mpptunnel is finished.

Check List

Tests

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

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Fix a bug that MPP tasks may leak threads forever

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Mar 14, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • fuzhe1989
  • windtalker

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/needs-triage-completed labels Mar 14, 2022
@bestwoody bestwoody requested review from fuzhe1989 and windtalker and removed request for fuzhe1989 March 14, 2022 03:12
@bestwoody bestwoody changed the title Fix a bug that MppTunnel and its consumer will not be closed as expected ocasionally when cancel Fix a bug that MppTunnel and its consumer will not be closed as expected ocasionally when canceled Mar 14, 2022
@bestwoody bestwoody changed the title Fix a bug that MppTunnel and its consumer will not be closed as expected ocasionally when canceled Fix a bug that MPP tasks may leak threads forever Mar 14, 2022
@SchrodingerZhu
Copy link
Contributor

/rebuild

@SchrodingerZhu
Copy link
Contributor

/run-all-tests

1 similar comment
@SchrodingerZhu
Copy link
Contributor

/run-all-tests

@SchrodingerZhu
Copy link
Contributor

/rebuild

@@ -218,6 +218,8 @@ void MPPTunnelBase<Writer>::connect(Writer * writer_)
std::unique_lock lk(mu);
if (connected)
throw Exception("has connected");
if (finished)
throw Exception("has finished");
Copy link
Contributor

Choose a reason for hiding this comment

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

the message is too sample, the same as L220.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

dbms/src/Flash/Mpp/MPPTunnel.cpp Outdated Show resolved Hide resolved
dbms/src/Flash/Mpp/MPPTunnel.cpp Outdated Show resolved Hide resolved
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Mar 14, 2022
Copy link
Contributor

@windtalker windtalker 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 added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Mar 15, 2022
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created: #4642.

ti-chi-bot pushed a commit to ti-chi-bot/tiflash that referenced this pull request Apr 13, 2022
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created: #4643.

ti-chi-bot pushed a commit to ti-chi-bot/tiflash that referenced this pull request Apr 13, 2022
ti-chi-bot pushed a commit to ti-chi-bot/tiflash that referenced this pull request Apr 13, 2022
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created: #4644.

@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created: #4645.

@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request could not be created: failed to create pull request against pingcap/tiflash#release-5.3 from head ti-chi-bot:cherry-pick-4241-to-release-5.3: the GitHub API request returns a 403 error: {"message":"You have exceeded a secondary rate limit and have been temporarily blocked from content creation. Please retry your request again later.","documentation_url":"https://docs.github.com/rest/overview/resources-in-the-rest-api#secondary-rate-limits"}

ti-chi-bot pushed a commit to ti-chi-bot/tiflash that referenced this pull request Apr 13, 2022
bestwoody added a commit to ti-chi-bot/tiflash that referenced this pull request Apr 13, 2022
bestwoody added a commit to ti-chi-bot/tiflash that referenced this pull request Apr 13, 2022
bestwoody added a commit to ti-chi-bot/tiflash that referenced this pull request Apr 13, 2022
@bestwoody bestwoody added needs-cherry-pick-release-5.3 Type: Need cherry pick to release-5.3 and removed needs-cherry-pick-release-5.3 Type: Need cherry pick to release-5.3 labels Apr 13, 2022
ti-chi-bot pushed a commit to ti-chi-bot/tiflash that referenced this pull request Apr 13, 2022
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created: #4647.

windtalker pushed a commit to windtalker/tiflash that referenced this pull request Apr 14, 2022
windtalker added a commit that referenced this pull request Apr 14, 2022
bestwoody added a commit that referenced this pull request Apr 14, 2022
* This is an automated cherry-pick of #4241

Signed-off-by: ti-chi-bot <[email protected]>

* Update MPPTunnel.cpp

* format

Co-authored-by: bestwoody <[email protected]>
Co-authored-by: ruoxi <[email protected]>
Co-authored-by: bestwoody <[email protected]>
bestwoody added a commit that referenced this pull request Apr 14, 2022
* This is an automated cherry-pick of #4241

Signed-off-by: ti-chi-bot <[email protected]>

* Update MPPTunnel.cpp

* pass code static check

Co-authored-by: bestwoody <[email protected]>
Co-authored-by: bestwoody <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-cherry-pick-release-5.0 PR which needs to be cherry-picked to release-5.0 needs-cherry-pick-release-5.1 PR which needs to be cherry-picked to release-5.1 needs-cherry-pick-release-5.2 PR which needs to be cherry-picked to release-5.2 needs-cherry-pick-release-5.3 Type: Need cherry pick to release-5.3 needs-cherry-pick-release-5.4 Should cherry pick this PR to release-5.4 branch. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MPP tasks may leak threads forever
6 participants