-
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 execute change pump state #11730
Conversation
Codecov Report
@@ Coverage Diff @@
## master #11730 +/- ##
===========================================
Coverage 81.5427% 81.5427%
===========================================
Files 435 435
Lines 94467 94467
===========================================
Hits 77031 77031
Misses 11947 11947
Partials 5489 5489 |
executor/executor.go
Outdated
sessVars := base.ctx.GetSessionVars() | ||
if atomic.CompareAndSwapUint32(&sessVars.Killed, 1, 0) { | ||
return ErrQueryInterrupted | ||
if base.ctx != nil { |
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.
When would base.ctx
be nil
?
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.
maybe some other Executor
forget to initial baseExecutor
just like ChangeExec
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.
Shall we make it an error to leave baseExecutor
out? It seems if it's nil
then we are introducing something that cannot be interrupted by KILL
here.
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.
removed, PTAL again
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.
How about adding a test for this case?
Please add a unit test case. |
… into xiang/fix_panic
/run-all-tests |
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.
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.
LGTM
/run-all-tests |
Please fix CI, @WangXiangUSTC . |
/run-all-tests |
/run-all-tests |
cherry pick to release-2.1 failed |
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. @WangXiangUSTC PTAL. |
What problem does this PR solve?
when execute sql like
change pump to node_state ='paused' for node_id 'pump1'
, tidb will return errorconnection running loop panic
What is changed and how it works?
fix it
Check List
Tests
Related changes