-
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
*: fix a data race on TestConnExecutionTimeout #35923
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Code Coverage Details: https://codecov.io/github/pingcap/tidb/commit/94d14735418190ca258ee248b04fcfd77f185891 |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 33f1684
|
/run-check_dev_2 |
2 similar comments
/run-check_dev_2 |
/run-check_dev_2 |
LGTM, thanks for fixing! |
/run-check_dev_2 |
/merge |
/rebuild |
/hold I need to investigate why collation test failed |
@tiancaiamao It meets a new data race in the tidb server. |
/run-check_dev_2 |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 771b2e8
|
/unhold |
TiDB MergeCI notify🔴 Bad News! New failing [1] after this pr merged.
|
What problem does this PR solve?
Issue Number: close #35922
Problem Summary:
What is changed and how it works?
This data race is introduced by #35803
There are two problems in that commit:
What's done in pr/35803 is that it add a check in the
Kill()
function,and from the stmtctx if it's found to be executing DDL, the kill is changed to
CancelDDL
.But this is not thread-safe ... check the stmtctx for it's state is not precise,
because the stmtctx might be constantly changing...
The been-killed session update it's stmtctx and then data race from the checking process.
In this commit, to avoid the data race, I change the logic to "just set the kill flag, and let the callee do the cancel operation"
Check List
Tests
No data race any more.
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.