-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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 panic when fetching processlist
table data in some cases
#11688
Conversation
Codecov Report
@@ Coverage Diff @@
## master #11688 +/- ##
===========================================
Coverage 81.4407% 81.4407%
===========================================
Files 429 429
Lines 92746 92746
===========================================
Hits 75533 75533
Misses 11821 11821
Partials 5392 5392 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add some UT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
It's hard to write some unit tests for this case. Actually, to locate this problem, I create an individual
It's not appropriate to write dead loops in our unit tests. |
PTAL @zz-jason |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/run-all-tests |
cherry pick to release-3.0 failed |
It seems that, not for sure, we failed to cherry-pick this commit to release-3.0. Please comment '/run-cherry-picker' to try to trigger the cherry-picker if we did fail to cherry-pick this commit before. @qw4990 PTAL. |
What problem does this PR solve?
When TiDB fetches data from
processlist
table, it will get each connection's memory consumption according to theirCtx.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
isnil
before using it when fetchingprocesslist
table data.