Skip to content

Remove prefetching loop#1984

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

Remove prefetching loop#1984
martindurant merged 2 commits intofsspec:masterfrom
TLCFEM:bugfix-avoid-pre-fetching

Conversation

@TLCFEM
Copy link
Contributor

@TLCFEM TLCFEM commented Feb 2, 2026

No description provided.

@martindurant
Copy link
Member

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


# byte position -> block numbers
start_block_number = start // self.blocksize
end_block_number = end // self.blocksize
Copy link
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.

"""
start_pos = start % self.blocksize
end_pos = end % self.blocksize
if end_pos == 0:
Copy link
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
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