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

fix data race and panic when exiting #396

Merged
merged 4 commits into from
Dec 23, 2021

Conversation

hawkingrei
Copy link
Member

@hawkingrei hawkingrei commented Dec 18, 2021

Signed-off-by: Weizhen Wang wangweizhen@pingcap.com

When you exit the KVStore, Some task will still call WaitGroup.Add. It is a dangerous way to make DATA RACE and panic between WaitGroup.Wait and WaitGroup.Add.

pingcap/tidb#30658
pingcap/tidb#30651

@hawkingrei hawkingrei changed the title fix the data race when exiting fix data race and panic when exiting Dec 18, 2021
@hawkingrei hawkingrei force-pushed the fix_data_race_when_store_exit branch 4 times, most recently from 0d18eef to a62b671 Compare December 20, 2021 03:02
Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
@hawkingrei
Copy link
Member Author

@disksing @sticnarf PTAL

txnkv/transaction/2pc.go Outdated Show resolved Hide resolved
txnkv/transaction/2pc.go Outdated Show resolved Hide resolved
txnkv/transaction/2pc.go Outdated Show resolved Hide resolved
Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
Copy link
Collaborator

@sticnarf sticnarf left a comment

Choose a reason for hiding this comment

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

LGTM

@sticnarf sticnarf merged commit 300275d into tikv:master Dec 23, 2021
@hawkingrei hawkingrei deleted the fix_data_race_when_store_exit branch December 23, 2021 06:22
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.

2 participants