Skip to content

v4.0: fix(fs): handle reads for file with zero size / limit (backport of #10900)#10927

Merged
kskalski merged 1 commit into
v4.0from
mergify/bp/v4.0/pr-10900
Mar 4, 2026
Merged

v4.0: fix(fs): handle reads for file with zero size / limit (backport of #10900)#10927
kskalski merged 1 commit into
v4.0from
mergify/bp/v4.0/pr-10900

Conversation

@mergify
Copy link
Copy Markdown

@mergify mergify Bot commented Mar 3, 2026

Problem

Files with 0 size or set to be read with limit 0 are not handled properly by SequentialFileReader.

This bug was introduced by #9701, which:

  • added limits for read file length (obviously not handling 0 properly)
  • added concept of reading a sequence of multiple files (causes a bit more complexity when handling switch between current and next file if current or next files have read limit 0)

Summary of Changes

The fix covers two areas:

  • skip obtaining full buffer if the current file state indicates no scheduled reads - this only happens for current file when read_limit == 0 (read ops are skipped and start_buf_index is never set)
  • when moving to read next file (i.e. discarding current file as finished reading from) we should:
    • only reclaim buffers if that file did any reads
    • make sure we look through all queued files to search for buffer index that was used for next scheduled read (some queued files might be zero limited) or fallback properly to the index to be used as such
      This is an automatic backport of pull request fix(fs): handle reads for file with zero size / limit #10900 done by Mergify.

@mergify mergify Bot requested a review from a team as a code owner March 3, 2026 03:22
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 29.62963% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.6%. Comparing base (ea743f9) to head (dcab353).

Additional details and impacted files
@@             Coverage Diff             @@
##             v4.0   #10927       +/-   ##
===========================================
- Coverage    83.0%    68.6%    -14.5%     
===========================================
  Files         836      747       -89     
  Lines      316338   215278   -101060     
===========================================
- Hits       262659   147724   -114935     
- Misses      53679    67554    +13875     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kskalski kskalski merged commit c852603 into v4.0 Mar 4, 2026
50 checks passed
@kskalski kskalski deleted the mergify/bp/v4.0/pr-10900 branch March 4, 2026 22:15
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.

4 participants