Skip to content

Attempt to fix abort from parallel parsing#42496

Merged
nikitamikhaylov merged 6 commits intomasterfrom
parallel-parsing-abort-fix
Oct 20, 2022
Merged

Attempt to fix abort from parallel parsing#42496
nikitamikhaylov merged 6 commits intomasterfrom
parallel-parsing-abort-fix

Conversation

@nikitamikhaylov
Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

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

This closes #42009

CC @azat

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

@robot-ch-test-poll2 robot-ch-test-poll2 added the pr-not-for-changelog This PR should not be mentioned in the changelog label Oct 19, 2022
/// thread->join();
/// Where join() won't be executed in case when we call it
/// from the same std::thread and it will end to std::abort().
if (state->finished)
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.

But joining the thread (std::thread, pthread) from itself is UB, in reality it will likely hang.
Maybe it is better to keep this function consistent with std::thread and leave it as-is.
And instead implicitly reset the state if it is finished in the dtor?

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.

Ok. I also had an idea to make this abstraction similar to std::jthread (auto joinable in destructor)

@nikitamikhaylov nikitamikhaylov merged commit 4d703b7 into master Oct 20, 2022
@nikitamikhaylov nikitamikhaylov deleted the parallel-parsing-abort-fix branch October 20, 2022 15:13
KochetovNicolai added a commit that referenced this pull request Oct 20, 2022
@tavplubix tavplubix mentioned this pull request Oct 21, 2022
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.

Abort in ~ParallelParsingInputFormat

4 participants