Skip to content

Fix data race in Connection::setAsyncCallback on unknown packet from server - #52219

Merged
Avogar merged 3 commits into
ClickHouse:masterfrom
Avogar:fix-race-in-multiplexed-connections
Jul 19, 2023
Merged

Avogar merged 3 commits into
ClickHouse:masterfrom
Avogar:fix-race-in-multiplexed-connections

Conversation

@Avogar

@Avogar Avogar commented Jul 17, 2023

Copy link
Copy Markdown
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):

Fix data race on Connection::setAsyncCallback.

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-clickhouse-ci-1 robot-clickhouse-ci-1 added the pr-bugfix Pull request with bugfix, not backported by default label Jul 17, 2023
@robot-clickhouse-ci-1

robot-clickhouse-ci-1 commented Jul 17, 2023 •

Copy link
Copy Markdown
Contributor

This is an automated comment for commit 06e366d with description of existing statuses. It's updated for the latest CI running
The full report is available here
The overall status of the commit is 🟡 pending

Check nameDescriptionStatus
CI runningA meta-check that indicates the running CI. Normally, it's in success or pending state. The failed status indicates some problems with the PR🟡 pending
Fast testNormally this is the first check that is ran for a PR. It builds ClickHouse and runs most of stateless functional tests, omitting some. If it fails, further checks are not started until it is fixed. Look at the report to see which tests fail, then reproduce the failure locally as described here🟢 success
Mergeable CheckChecks if all other necessary checks are successful🟢 success
Push to DockerhubThe check for building and pushing the CI related docker images to docker hub🟢 success
Style CheckRuns a set of checks to keep the code style clean. If some of tests failed, see the related log from the report🟢 success

@Avogar Avogar changed the title Fix data race on Connection::setAsyncCallback Fix data race in Connection::setAsyncCallback on unknown packet from server Jul 17, 2023
Packet packet;
try
{
AsyncCallbackSetter async_setter(current_connection, std::move(async_callback));

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Previously this AsyncCallbackSetter could be destroyed after invalidateReplica() is called, so we could touch connection that was already returned to connection pool

@davenger davenger self-assigned this Jul 17, 2023
@Avogar
Avogar merged commit c4d881c into ClickHouse:master Jul 19, 2023
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.

4 participants