Repository navigation
feat: Exponential read-ahead cache - #140
Conversation
weiji14
left a comment
There was a problem hiding this comment.
Recommend to add a unit test 🙂
| let chunk = b.slice(start..end); | ||
| out_buffers.push(chunk); |
There was a problem hiding this comment.
The slice here might return an empty chunk, and the .push would fail with "IOError(Error { kind: UnexpectedEof, message: "failed to fill whole buffer" })". Maybe re-check the logic here?
There was a problem hiding this comment.
Can you think of an example of a unit test that would catch this?
There was a problem hiding this comment.
I think I added a relevant change and test in 4a6b9d7 (#140). I'll merge but feel free to review and give feedback, and we can still change it later.
There was a problem hiding this comment.
Sorry for the late reply. I think the changes are fine. Have merged the new changed from this PR into #141 (where the error was showing up), and it's working great now without needing to manually set a prefetch buffer size!
|
I added some unit tests in |
Replace simple prefetch buffer with exponential readahead cache for more efficient metadata fetching, and improve Python error handling.
Supersedes and closes #83, closes #89
Change list
ReadaheadMetadataCachegrows fetch sizes (configurable viainitial_sizeandmultiplierparameters)PyAsyncTiffErrorenum, so the existing test that checked forFileNotFoundErrorwould still pass. Better exception handling is tracked in Improved Python error handling #144