Skip to content
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

[BUG] [Parquet] Fix double-await on JoinHandles concurrency bug in Parquet reader. #1841

Merged
merged 4 commits into from
Feb 7, 2024

Conversation

clarkzinzow
Copy link
Contributor

@clarkzinzow clarkzinzow commented Feb 5, 2024

This PR fixes a double-await concurrency bug on JoinHandles in the Parquet reader. The bug appears to arise when an a byte range fetch fails: we currently short-circuit that fetch and return an error to the stream mapper without changing the range cache state. This means that future fetches that overlap with that byte range will try to .await on the same JoinHandle, which is not allowed.

This PR fixes this by storing a Result<Bytes, Error> in RangeCacheState::Ready(), so we can stash errors from past fetches.

TODOs

  • Validate on TPC-H Q1 benchmark reproduction.
  • Ensure that PR matches at least the status quo in terms of fault-tolerance

@clarkzinzow clarkzinzow changed the title [Parquet] Fix double-await on JoinHandles concurrency bug in Parquet reader. [BUG] [Parquet] Fix double-await on JoinHandles concurrency bug in Parquet reader. Feb 5, 2024
@github-actions github-actions bot added the bug Something isn't working label Feb 5, 2024
Copy link

codecov bot commented Feb 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (4734862) 85.60% compared to head (5cad53a) 85.62%.
Report is 5 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1841      +/-   ##
==========================================
+ Coverage   85.60%   85.62%   +0.02%     
==========================================
  Files          55       55              
  Lines        6079     6102      +23     
==========================================
+ Hits         5204     5225      +21     
- Misses        875      877       +2     
Files Coverage Δ
daft/dataframe/dataframe.py 88.36% <100.00%> (+0.10%) ⬆️
daft/logical/builder.py 89.91% <100.00%> (+0.35%) ⬆️

... and 3 files with indirect coverage changes

@clarkzinzow clarkzinzow merged commit db7cfd1 into main Feb 7, 2024
42 checks passed
@clarkzinzow clarkzinzow deleted the clark/parquet-double-await-fix branch February 7, 2024 22:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants