Skip to content

ParallelFormattingOutputFormat: Use mutex to handle the join to the collector_thread#26703

Merged
nikitamikhaylov merged 1 commit intoClickHouse:masterfrom
Algunenano:threadpool_safety
Jul 27, 2021
Merged

ParallelFormattingOutputFormat: Use mutex to handle the join to the collector_thread#26703
nikitamikhaylov merged 1 commit intoClickHouse:masterfrom
Algunenano:threadpool_safety

Conversation

@Algunenano
Copy link
Copy Markdown
Member

@Algunenano Algunenano commented Jul 22, 2021

I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en

Changelog category (leave one):

  • Bug Fix

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
ParallelFormattingOutputFormat: Use mutex to handle the join to the collector_thread (#26694)

Detailed description / Documentation draft:

Fixes #26694

@robot-clickhouse robot-clickhouse added the pr-bugfix Pull request with bugfix, not backported by default label Jul 22, 2021
@nikitamikhaylov nikitamikhaylov self-assigned this Jul 22, 2021
@KochetovNicolai
Copy link
Copy Markdown
Member

Hm, it seem to me strange to add another one mutex to ThreadFromGlobalPool. Looks like std::thread::join also can't be called concurrently. I suppose, user code should be responsible for synchronization here (like, store mutex externally, along with thread if needed).

@Algunenano
Copy link
Copy Markdown
Member Author

I suppose, user code should be responsible for synchronization here (like, store mutex externally, along with thread if needed).

Sure, that makes sense to me too. I'll revert those changes and try to fix only #26694 by fixing the caller.

@Algunenano Algunenano changed the title ThreadFromGlobalPool: Improve atomicity ParallelFormattingOutputFormat: Use mutex to handle the join to the collector_thread Jul 26, 2021
@Algunenano
Copy link
Copy Markdown
Member Author

rabbitmq are broken everywhere, there are some flaky tests and I can't see the result of the functional tests (internal Yandex link) so I don't know if it's related or not.

@KochetovNicolai
Copy link
Copy Markdown
Member

internal Yandex link is also broken everywhere for some time

@nikitamikhaylov nikitamikhaylov merged commit 7bf0fc2 into ClickHouse:master Jul 27, 2021
robot-clickhouse pushed a commit that referenced this pull request Jul 27, 2021
… handle the join to the collector_thread
robot-clickhouse pushed a commit that referenced this pull request Jul 27, 2021
… handle the join to the collector_thread
robot-clickhouse pushed a commit that referenced this pull request Jul 27, 2021
… handle the join to the collector_thread
robot-clickhouse pushed a commit that referenced this pull request Jul 27, 2021
… handle the join to the collector_thread
robot-clickhouse pushed a commit that referenced this pull request Jul 27, 2021
… handle the join to the collector_thread
nikitamikhaylov added a commit that referenced this pull request Jul 29, 2021
Backport #26703 to 21.3: ParallelFormattingOutputFormat: Use mutex to handle the join to the collector_thread
nikitamikhaylov added a commit that referenced this pull request Jul 29, 2021
Backport #26703 to 21.6: ParallelFormattingOutputFormat: Use mutex to handle the join to the collector_thread
nikitamikhaylov added a commit that referenced this pull request Aug 2, 2021
Backport #26703 to 21.8: ParallelFormattingOutputFormat: Use mutex to handle the join to the collector_thread
nikitamikhaylov added a commit that referenced this pull request Aug 2, 2021
Backport #26703 to 21.5: ParallelFormattingOutputFormat: Use mutex to handle the join to the collector_thread
nikitamikhaylov added a commit that referenced this pull request Aug 2, 2021
Backport #26703 to 21.7: ParallelFormattingOutputFormat: Use mutex to handle the join to the collector_thread
zhanglistar pushed a commit to zhanglistar/ClickHouse that referenced this pull request Nov 12, 2021
…e mutex to handle the join to the collector_thread
zhanglistar pushed a commit to zhanglistar/ClickHouse that referenced this pull request Nov 12, 2021
Backport ClickHouse#26703 to 21.8: ParallelFormattingOutputFormat: Use mutex to handle the join to the collector_thread
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.

TSAN: data-race in ThreadFromGlobalPool joinable() + join()

5 participants