Skip to content

Wait pool in ParallelFormattingOutputFormat::finalizeImpl#71135

Closed
vdimir wants to merge 6 commits intomasterfrom
vdimir/fix-race-client-formatting2
Closed

Wait pool in ParallelFormattingOutputFormat::finalizeImpl#71135
vdimir wants to merge 6 commits intomasterfrom
vdimir/fix-race-client-formatting2

Conversation

@vdimir
Copy link
Copy Markdown
Member

@vdimir vdimir commented Oct 28, 2024

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):

...

close #68791

@robot-ch-test-poll robot-ch-test-poll added the pr-not-for-changelog This PR should not be mentioned in the changelog label Oct 28, 2024
@robot-clickhouse-ci-2
Copy link
Copy Markdown
Contributor

robot-clickhouse-ci-2 commented Oct 28, 2024

This is an automated comment for commit efd5830 with description of existing statuses. It's updated for the latest CI running

❌ Click here to open a full report in a separate page

Check nameDescriptionStatus
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❌ failure
Successful checks
Check nameDescriptionStatus
Docs checkBuilds and tests the documentation✅ 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

@novikd novikd self-assigned this Oct 28, 2024
formatter->finalizeImpl();

formatter->finalizeBuffers();
finishAndWait();
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.

Maybe it's better to call pool.wait() because finishAndWait() does emergency_stop = true;?

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.

Maybe we need to set emergency_stop to let thread to finish (so, it's not emergence, but just stop). Let's check how it works without setting this flag from finalizeImpl

@vdimir
Copy link
Copy Markdown
Member Author

vdimir commented Oct 30, 2024

Integration tests (asan, old analyzer) [6/6] — fail: 1, passed: 488 Details

#71237

@vdimir vdimir enabled auto-merge October 30, 2024 09:55
void ParallelFormattingOutputFormat::finishAndWait(bool emergency_stop_) noexcept
{
emergency_stop = true;
emergency_stop = emergency_stop_;
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.

What if emergency_stop is already set to true, but you set it to false? Let's do something like:

bool expected = false;
emergency_stop. compare_exchange_strong(expected, emergency_stop_);

@vdimir
Copy link
Copy Markdown
Member Author

vdimir commented Oct 31, 2024

@vdimir
Copy link
Copy Markdown
Member Author

vdimir commented Oct 31, 2024

Without setting emergency_stop background thread continues executing, renamed it to stop_flag

@vdimir
Copy link
Copy Markdown
Member Author

vdimir commented Nov 1, 2024

Closed in favor to #71304

@vdimir vdimir closed this Nov 1, 2024
auto-merge was automatically disabled November 1, 2024 08:32

Pull request was closed

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.

4 participants