Skip to content

fix: Move logic into the thread::scope call so it doesn't hang #1040

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

nicklan
Copy link
Collaborator

@nicklan nicklan commented Jul 1, 2025

What changes are proposed in this pull request?

Previously in #957 we moved the code to use thread::scope. This allows not having to clone an engine arc, but also means that all the threads are implicitly joined at the end of the scope call.

This meant that we waited for the threads to exit before ever sending them any work, so the version on main hangs 😱 .

Instead we need to move all the rest of the logic inside the scope call and only let the implicit joining happen at the end.

How was this change tested?

Running the program on a few tables

@nicklan nicklan force-pushed the fix-thread-scope-issue-read-table-multi branch from abe5d9f to eec4c58 Compare July 1, 2025 00:31
// have handed out all copies needed, drop so record_batch_rx will exit when the last thread is
// done sending
drop(record_batch_tx);
// have handed out all copies needed, drop so record_batch_rx will exit when the last thread is
Copy link
Collaborator Author

@nicklan nicklan Jul 1, 2025

Choose a reason for hiding this comment

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

If you're seeing this comment as being on a change, turn on "Hide Whitespace"

@nicklan nicklan requested review from zachschuermann, scovich and OussamaSaoudi and removed request for scovich July 1, 2025 00:34
Copy link
Collaborator

@zachschuermann zachschuermann left a comment

Choose a reason for hiding this comment

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

yikes! thanks for the fix. sorry i missed that! maybe we should have example “tests” that run examples to make sure they work? (not to solve here but maybe as follow up)

@nicklan nicklan force-pushed the fix-thread-scope-issue-read-table-multi branch from 264f456 to c12f44f Compare July 3, 2025 00:27
@nicklan nicklan requested review from hntd187 and roeap July 3, 2025 00:27
Copy link

codecov bot commented Jul 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.74%. Comparing base (54d1994) to head (c12f44f).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1040   +/-   ##
=======================================
  Coverage   83.74%   83.74%           
=======================================
  Files          92       92           
  Lines       21070    21070           
  Branches    21070    21070           
=======================================
  Hits        17646    17646           
  Misses       2509     2509           
  Partials      915      915           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@nicklan nicklan merged commit 32f85fd into delta-io:main Jul 3, 2025
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants