Skip to content

Remove prefetching loop - #1984

Merged
martindurant merged 2 commits into
fsspec:masterfrom
TLCFEM:bugfix-avoid-pre-fetching
Feb 2, 2026
Merged

martindurant merged 2 commits into
fsspec:masterfrom
TLCFEM:bugfix-avoid-pre-fetching

Conversation

@TLCFEM

@TLCFEM TLCFEM commented Feb 2, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@martindurant

Copy link
Copy Markdown
Member

OK, nothing broke. Can we generate a test to show that no double-reading happens, but that would have with the previous version?

Comment thread fsspec/caching.py

# byte position -> block numbers
start_block_number = start // self.blocksize
end_block_number = end // self.blocksize

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The calculation of end_block_number is not correct.

Comment thread fsspec/caching.py
"""
start_pos = start % self.blocksize
end_pos = end % self.blocksize
if end_pos == 0:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This, with the previous (end - 1) // self.blocksize, avoid reading the extra block, which may or may not exist.

@martindurant

Copy link
Copy Markdown
Member

Thank you!

@martindurant
martindurant merged commit 1de5e1d into fsspec:master Feb 2, 2026
10 checks passed
@TLCFEM
TLCFEM deleted the bugfix-avoid-pre-fetching branch February 3, 2026 19:49
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.

2 participants