Xuanwo opened a new pull request, #8816: URL: https://github.com/apache/opendal/pull/8816
# Which issue does this PR close? N/A. The included deterministic regression tests reproduce the defect. # Rationale for this change `RetryReadStream` decides that a temporary error is a clean EOF only when the tracked range size equals the number of bytes read. `RetryReader::open` resolved only suffix ranges, so an unbounded forward range or a bounded range extending past the object kept its original size. After the last available byte, a temporary error on the trailing `read()` advanced the range to the object end and reopened an empty range. The backend or `CompleteReader` then rejected it with `RangeNotSatisfied`, consuming retry budget and failing the read permanently. # What changes are included in this PR? - Resolve forward ranges against the file content length reported by `RpRead`, matching `CompleteReader`: an unbounded range becomes bounded by the remaining bytes, and an over-EOF bounded range is clamped to the available bytes. Ranges without file metadata stay unchanged. - Keep the existing suffix resolution behavior when generalizing the helper to `resolve_range`. - Add deterministic regression tests for an over-EOF bounded read, an unbounded read, and a mid-stream temporary error. The mid-stream test verifies recovery opens the remaining range without duplicating or truncating data. - Update existing unbounded-read expectations now that the final byte is terminal, and update the retry budget test to assert the single deposit at that completion point. # Are there any user-facing changes? Reads through `RetryLayer` no longer fail with `RangeNotSatisfied` when the trailing EOF poll returns a temporary error for unbounded or over-EOF bounded ranges. Retry budget is not consumed for that EOF poll. No public API changes. # Breaking changes # AI Usage Statement - Harness: Pi (T3 Code) - Model: group/deepseek - Effort: max - Role: Verified the root cause, added deterministic regression tests that fail before the fix, implemented the range clamping, and ran formatting, clippy, and the retry crate tests. The tests use in-process readers; no live service requests were made. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
