Add AsyncRequestBody#fromInputStream(AsyncRequestBodyFromInputStreamC… #4643
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.
…onfiguration) to allow users to specify the max read limit on the InputStream
Motivation and Context
Transient network error is not uncommon when customers upload objects of a larger size to S3 and those failed requests would normally succeed upon retry. However, if users use
AsyncRequestBodyFromInputStream
as theAsyncRequestBody
and the stream is larger than the default mark value, the SDK may not be able to retry the request in the event of network issue. This is because the default read limit of the provided inputStream used for mark and reset is 128KB.Related to aws/aws-sdk-java#427
Notes:
This option is exposed in v1 via RequestClientOptions#setReadLimit. I did not include this in the ReqeustOverrideConfiguration because this only applies to
InputStream
only.This is technically possible to do in
RequestBody
, (RequestBody#fromContentProvider
), that's why I didn't make the change in RequestBodyModifications
Add
AsyncRequestBody#fromInputStream(AsyncRequestBodyFromInputStreamConfiguration)
that allow users to configure max read limit.Testing
Added unit tests
Screenshots (if appropriate)
Types of changes
Checklist
mvn install
succeedsscripts/new-change
script and following the instructions. Commit the new file created by the script in.changes/next-release
with your changes.License