Skip to content

Conversation

@wjones127
Copy link
Contributor

Summary

  • Added bounds checking before Bytes::slice() calls in FileScheduler::submit_request
  • Added bounds checking in BufferScheduler::satisfy_request

Previously, if the returned data was shorter than expected (due to file
truncation, corruption, or other issues), the code would panic with "range
end out of bounds". Now it returns a proper error with context about the
expected vs actual buffer size.

Fixes #5674

🤖 Generated with Claude Code

When reconstructing byte ranges from split/coalesced I/O requests,
`Bytes::slice()` was called without bounds validation. If the returned
data was shorter than expected, this would panic instead of returning
a meaningful error.

Added bounds checking before slice operations in `FileScheduler` and
`BufferScheduler`.

Fixes lance-format#5674

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@github-actions github-actions bot added the bug Something isn't working label Jan 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

thread 'tokio-runtime-worker' panicked at 'range end out of bounds: 8 <= 0'

1 participant