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

make ResourceControlInterceptor atomic #848

Merged
merged 2 commits into from
Jun 21, 2023

Conversation

glorv
Copy link
Contributor

@glorv glorv commented Jun 20, 2023

ref pingcap/tidb#44818

pingcap/tidb#44819 is another attempt to fix the race but the test still failed https://do.pingcap.net/jenkins/job/pingcap/job/tidb/job/ghpr_unit_test/26946/display/redirect.

while in theory, we can init the ResourceControlInterceptor once when the server is bootstrapped. But due to some implementation restriction, it's hard to do so in tidb and the current code can case data race though the data race is harmless.

So this PR changes the type to atomic ptr for simplicity.

Signed-off-by: glorv <glorvs@163.com>
@glorv
Copy link
Contributor Author

glorv commented Jun 20, 2023

@nolouch @Connor1996 PTAL

Copy link
Contributor

@nolouch nolouch left a comment

Choose a reason for hiding this comment

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

lgtm

@hawkingrei
Copy link
Member

@disksing PTAL

Copy link
Member

@Connor1996 Connor1996 left a comment

Choose a reason for hiding this comment

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

LGTM

@Connor1996
Copy link
Member

test failed

Signed-off-by: glorv <glorvs@163.com>
@overvenus
Copy link
Member

/merge

@overvenus overvenus merged commit 864a5fc into tikv:master Jun 21, 2023
@glorv glorv deleted the atomic-interceptor branch June 21, 2023 03:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants