Skip to content

executor: fix panic when fetching processlist table data in some cases#11690

Merged
sre-bot merged 2 commits into
pingcap:release-2.1from
qw4990:release-2.1-spl-panic
Aug 9, 2019
Merged

executor: fix panic when fetching processlist table data in some cases#11690
sre-bot merged 2 commits into
pingcap:release-2.1from
qw4990:release-2.1-spl-panic

Conversation

@qw4990
Copy link
Copy Markdown
Contributor

@qw4990 qw4990 commented Aug 8, 2019

What problem does this PR solve?

When TiDB fetches data from processlist table, it will get each connection's memory consumption according to their Ctx.Memtracker.
But in some cases, Ctx.Memtracker is not initialized at that time, which results in a panic.

What is changed and how it works?

Check if Ctx.Memtracker is nil before using it when fetching processlist table data.

@qw4990 qw4990 added type/bugfix This PR fixes a bug. sig/execution SIG execution labels Aug 8, 2019
@qw4990 qw4990 requested review from lysu, tiancaiamao and zz-jason August 8, 2019 11:21
@ngaut
Copy link
Copy Markdown
Member

ngaut commented Aug 8, 2019

This is a serious issue, we should cherry-pick it to version 3.0.

@qw4990
Copy link
Copy Markdown
Contributor Author

qw4990 commented Aug 8, 2019

This is a serious issue, we should cherry-pick it to version 3.0.

Yes, there is another PR(#11688) on master.
I will cherry-pick #11688 into the branch 3.0 after it is merged into master.

Copy link
Copy Markdown
Contributor

@lysu lysu left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
Member

@ngaut ngaut left a comment

Choose a reason for hiding this comment

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

LGTM

@ngaut ngaut added status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. labels Aug 9, 2019
@sre-bot
Copy link
Copy Markdown
Contributor

sre-bot commented Aug 9, 2019

/run-all-tests

@sre-bot sre-bot merged commit 186f464 into pingcap:release-2.1 Aug 9, 2019
qw4990 added a commit to qw4990/tidb that referenced this pull request Aug 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sig/execution SIG execution status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. type/bugfix This PR fixes a bug.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants