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

executor: fix mppIterator memory leak when got error #52410

Merged
merged 3 commits into from
Apr 9, 2024

Conversation

guo-shaoge
Copy link
Collaborator

@guo-shaoge guo-shaoge commented Apr 8, 2024

What problem does this PR solve?

Issue Number: close #52406

Problem Summary: check issue for detail description

What changed and how does it work?

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.

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

Please refer to Release Notes Language Style Guide to write a quality release note.

None

Signed-off-by: guo-shaoge <shaoge1994@163.com>
@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-triage-completed do-not-merge/needs-tests-checked release-note-none Denotes a PR that doesn't merit a release note. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Apr 8, 2024
Copy link

tiprow bot commented Apr 8, 2024

Hi @guo-shaoge. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

I understand the commands that are listed here.

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 kubernetes/test-infra repository.

Copy link

codecov bot commented Apr 8, 2024

Codecov Report

Merging #52410 (e487d8e) into master (c39d79f) will increase coverage by 0.3421%.
Report is 14 commits behind head on master.
The diff coverage is 0.0000%.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #52410        +/-   ##
================================================
+ Coverage   74.1210%   74.4632%   +0.3421%     
================================================
  Files          1467       1467                
  Lines        354273     429648     +75375     
================================================
+ Hits         262591     319930     +57339     
- Misses        72444      89794     +17350     
- Partials      19238      19924       +686     
Flag Coverage Δ
integration 48.9601% <0.0000%> (?)
unit 71.0019% <0.0000%> (-1.8772%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 53.9957% <ø> (-2.3014%) ⬇️
parser ∅ <ø> (∅)
br 49.4395% <ø> (+7.0017%) ⬆️

Signed-off-by: guo-shaoge <shaoge1994@163.com>
@guo-shaoge
Copy link
Collaborator Author

/retest

Copy link

tiprow bot commented Apr 9, 2024

@guo-shaoge: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest

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 kubernetes/test-infra repository.

@guo-shaoge guo-shaoge requested a review from XuHuaiyu April 9, 2024 03:34
@guo-shaoge guo-shaoge changed the title executor: fix mppIterator memory leak when go error executor: fix mppIterator memory leak when got error Apr 9, 2024
@@ -498,6 +498,7 @@ func (c *localMppCoordinator) cancelMppTasks() {
func (c *localMppCoordinator) receiveResults(req *kv.MPPDispatchRequest, taskMeta *mpp.TaskMeta, bo *backoff.Backoffer) {
stream, err := c.sessionCtx.GetMPPClient().EstablishMPPConns(kv.EstablishMPPConnsParam{Ctx: bo.GetCtx(), Req: req, TaskMeta: taskMeta})
if err != nil {
stream.Close()
Copy link
Contributor

Choose a reason for hiding this comment

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

How about move L511 after L499?

Copy link
Collaborator Author

@guo-shaoge guo-shaoge Apr 9, 2024

Choose a reason for hiding this comment

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

Golang lint will report error: pkg/executor/internal/mpp/local_mpp_coordinator.go:500:2: should check returned error before deferring stream.Close() (SA5001)

Signed-off-by: guo-shaoge <shaoge1994@163.com>
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 bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Apr 9, 2024
@guo-shaoge guo-shaoge requested a review from SeaRise April 9, 2024 07:36
Copy link

ti-chi-bot bot commented Apr 9, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: SeaRise, windtalker

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

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Apr 9, 2024
Copy link

ti-chi-bot bot commented Apr 9, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-04-09 07:34:57.53266097 +0000 UTC m=+947759.060201509: ☑️ agreed by windtalker.
  • 2024-04-09 07:59:08.864357927 +0000 UTC m=+949210.391898473: ☑️ agreed by SeaRise.

@ti-chi-bot ti-chi-bot bot merged commit 38f665a into pingcap:master Apr 9, 2024
23 checks passed
@guo-shaoge guo-shaoge deleted the fix_mppiterator_mem_leak branch April 10, 2024 02:09
3AceShowHand pushed a commit to 3AceShowHand/tidb that referenced this pull request Apr 16, 2024
@ti-chi-bot ti-chi-bot added the needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. label May 8, 2024
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-8.1: #53105.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. release-note-none Denotes a PR that doesn't merit a release note. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mppIterator memory leak when got error
4 participants