Added error field to block to throw exception early#333
Merged
ozkoca merged 2 commits intoawslabs:physical-io-featurefrom Jul 28, 2025
Merged
Added error field to block to throw exception early#333ozkoca merged 2 commits intoawslabs:physical-io-featurefrom
ozkoca merged 2 commits intoawslabs:physical-io-featurefrom
Conversation
fuatbasik
approved these changes
Jul 28, 2025
| // This value should be Default ReadAhead bytes or read buffer size whichever | ||
| // is higher. Currently, default read buffer size is 128KB, this value | ||
| // should be 128KB | ||
| private static final int DEFAULT_READ_BYTES = 128 * ONE_KB; |
Collaborator
There was a problem hiding this comment.
Which means default read-ahead bytes would be 128KB min. right? Should we align these fields and call it min. read size maybe?
Collaborator
Author
There was a problem hiding this comment.
Right. Renamed as suggested
| public int read(long pos) throws IOException { | ||
| Preconditions.checkArgument(0 <= pos, "`pos` must not be negative"); | ||
| awaitDataWithRetry(); | ||
| if (error != null) { |
Collaborator
There was a problem hiding this comment.
should we move this check to awaitData?
Collaborator
Author
There was a problem hiding this comment.
If we move this check to awaitData, library will keep retrying due to the retry strategy. With existing, when there is an error, we will throw exception without retry
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.
Description of change
This PR supports Block.read method to throw Exception without retry when SDK throws Status Code: 412 exception, when etag of a file changes.
Relevant issues
#325
Does this contribution introduce any breaking changes to the existing APIs or behaviors?
No
Does this contribution introduce any new public APIs or behaviors?
No
How was the contribution tested?
Unit tests, integration tests
Does this contribution need a changelog entry?
N/A
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and I agree to the terms of the Developer Certificate of Origin (DCO).