Skip to content

GH-43604: [C++] Let ReadaheadGenerator wait for readahead tasks at sh… - #43756

Closed
pitrou wants to merge 1 commit into
apache:mainfrom
pitrou:gh43604-readahead-gen
Closed

pitrou wants to merge 1 commit into
apache:mainfrom
pitrou:gh43604-readahead-gen

Conversation

@pitrou

@pitrou pitrou commented Aug 19, 2024 •

Copy link
Copy Markdown
Member

…utdown

Ensure that, when all consumer references to ReadaheadGenerator are lost, we wait for readahead tasks to finish before proceeding.

This is to avoid that further finalization steps at process shutdown trigger a crash in pending readahead tasks.

Rationale for this change

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

… at shutdown

Ensure that, when all consumer references to ReadaheadGenerator are lost, we wait for readahead tasks to finish before proceeding.

This is to avoid that further finalization steps at process shutdown trigger a crash in pending readahead tasks.
@github-actions

Copy link
Copy Markdown

⚠️ GitHub issue #43604 has been automatically assigned in GitHub to PR creator.

// tasks to end. While it adds latency, it also reduces the risk of
// shenanigans happening at process shutdown (e.g. GH-43604).
for (const auto& fut : state->readahead_queue) {
fut.Wait();

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.

Unfortunately, this seems to hang when a MergedGenerator is wrapped in ReadaheadGenerator and an error is propagated along.

(for example in test_dataset.py::test_checksum_write_dataset_read_dataset_to_table)

@westonpace Thoughts?

@github-actions

Copy link
Copy Markdown

Thank you for your contribution. Unfortunately, this pull request has been marked as stale because it has had no activity in the past 365 days. Please remove the stale label or comment below, or this PR will be closed in 14 days. Feel free to re-open this if it has been closed in error. If you do not have repository permissions to reopen the PR, please tag a maintainer.

@github-actions github-actions Bot added the Status: stale-warning Issues and PRs flagged as stale which are due to be closed if no indication otherwise label Nov 18, 2025
@github-actions github-actions Bot closed this Feb 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component: C++ Status: stale-warning Issues and PRs flagged as stale which are due to be closed if no indication otherwise

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant