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 for race in ZooKeeper when joining send_thread/receive_thread #48849

Merged
merged 2 commits into from
Apr 18, 2023

Conversation

davenger
Copy link
Member

Changelog category (leave one):

  • Bug Fix (user-visible misbehavior in an official stable release)

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

Fixes #45431

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

Information about CI checks: https://clickhouse.com/docs/en/development/continuous-integration/

@robot-ch-test-poll2 robot-ch-test-poll2 added the pr-bugfix Pull request with bugfix, not backported by default label Apr 17, 2023
@davenger davenger changed the title A wrapper to allow calling join() from multiple threads Fix for race in ZooKeeper when joining send_thread/receive_thread Apr 17, 2023
@antonio2368 antonio2368 self-assigned this Apr 17, 2023
Copy link
Member

@antonio2368 antonio2368 left a comment

Choose a reason for hiding this comment

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

It works as a quick fix, but I think the core problem of calling join from many different places is still confusing.
Still, I'm okay with this because it doesn't seem straightforward to me how to change the code to only have joins in the destructor.

@davenger
Copy link
Member Author

It works as a quick fix, but I think the core problem of calling join from many different places is still confusing. Still, I'm okay with this because it doesn't seem straightforward to me how to change the code to only have joins in the destructor.

Yep, that was exactly my thinking! It would be much cleaner to only have join()-s in dtor, but it's not obvious how to fix it.

@davenger davenger merged commit 2728ce2 into master Apr 18, 2023
137 checks passed
@davenger davenger deleted the fix_zookeeper_join_race branch April 18, 2023 07:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-bugfix Pull request with bugfix, not backported by default
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ThreadSanitizer: data race in ThreadFromGlobalPoolImpl::join()
3 participants