Repository navigation
fix a race in ftp prefetching when using max_concurrent_requests - #2519
Open
davidszotten wants to merge 1 commit into
Open
davidszotten wants to merge 1 commit into
davidszotten wants to merge 1 commit into
Conversation
when `max_concurrent_requests` is set, it's possible to empty the list of prefetch extents by reading faster than they are enqueued. currently this makes us mistakenly thing the prefetching is all done. reading still works, but it starts ignoring the prefetch which, in particular, means that in the common case of reading an entire file, the prefetch buffers continue filling but are never emptied causing excessive memory use. fix this by explicitly keeping track of when we're done enqueueing.
davidszotten
force-pushed
the
fix-prefetch-race
branch
from
June 19, 2025 08:51
1487728 to
261ecf1
Compare
Author
|
it looks like the original implementation was by @kschoelhorn and @bwinston-sdp . does this look like the correct diagnosis and reasonable fix to you? |
|
does this mean we can pass |
Contributor
|
nice find @davidszotten! this seems like the correct diagnosis to me, but I will defer to @bitprophet and/or other maintainers with a better mental model of the prefetch code. |
klemens
approved these changes
Jul 30, 2025
klemens
left a comment
There was a problem hiding this comment.
This looks good to me! I somehow didn't notice this when doing #2058. (@kschoelhorn is my work account).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
when
max_concurrent_requestsis set, it's possible to empty the list of prefetch extents by reading faster than they are enqueued. currently this makes us mistakenly thing the prefetching is all done. reading still works, but it starts ignoring the prefetch which, in particular, means that in the common case of reading an entire file, the prefetch buffers continue filling but are never emptied causing excessive memory use.fix this by explicitly keeping track of when we're done enqueueing.