Skip to content

Fix data race in CompletedPipelineExecutor. - #39132

Merged
KochetovNicolai merged 1 commit into
masterfrom
fix-data-race-in-completed-pipeline-executor
Jul 13, 2022
Merged

KochetovNicolai merged 1 commit into
masterfrom
fix-data-race-in-completed-pipeline-executor

Conversation

@KochetovNicolai

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

Closes #38645 and #38562

@robot-clickhouse robot-clickhouse added the pr-not-for-changelog This PR should not be mentioned in the changelog label Jul 12, 2022
auto func = [data_ptr = data.get(), num_threads = pipeline.getNumThreads(), thread_group = CurrentThread::getGroup()]()
{
threadFunction(*data, thread_group, pipeline.getNumThreads());
threadFunction(*data_ptr, thread_group, num_threads);

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.

Was able to reproduce by adding std::this_thread::sleep_for(std::chrono::milliseconds(100)); here with

$ for i in $(seq 1 100); do timeout -s 2 0.031 clickhouse client --interactive_delay 1000 -q "insert into tab select number, toString(number) from system.numbers"; done

Won't add a test cause don't like to add another one setting for sleep.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Does it make sense to add .sh test that executes this command? Maybe ThreadFuzzer will add sleeps :)

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.

I have the same idea. Still, it's very hard to catch. Timeout is tricky, and I suppose it worked only for my machine.
But let's add :)

@antonio2368 antonio2368 self-assigned this Jul 13, 2022
@KochetovNicolai
KochetovNicolai merged commit 4f8cc87 into master Jul 13, 2022
@KochetovNicolai
KochetovNicolai deleted the fix-data-race-in-completed-pipeline-executor branch July 13, 2022 11:39
KochetovNicolai added a commit that referenced this pull request Jul 13, 2022
KochetovNicolai added a commit that referenced this pull request Jul 13, 2022
yokofly added a commit to timeplus-io/proton that referenced this pull request Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-not-for-changelog This PR should not be mentioned in the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Segfault in CompletedPipelineExecutor

4 participants