When doing S3 PutObject with flexible checksums with S3AsyncClient, the ChecksumCalculatingAsyncRequestBody adds chunk headers and trailers to each chunk. We should skip this if there is a non-final empty chunk of length 0, as it causes an error to be thrown
S3Exception: You did not provide the number of bytes specified by the Content-Length HTTP header
Modifications
In onNext(), return the ByteBuffer as is, if it is empty and non-final chunk
Testing
added unit tests, performed one-off integ tests
Screenshots (if appropriate)
Types of changes
[x] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] My code follows the code style of this project
[ ] My change requires a change to the Javadoc documentation
[ ] I have updated the Javadoc documentation accordingly
[ ] I have added tests to cover my changes
[ ] All new and existing tests passed
[ ] I have added a changelog entry. Adding a new entry must be accomplished by running the scripts/new-change script and following the instructions. Commit the new file created by the script in .changes/next-release with your changes.
[ ] My change is to implement 1.11 parity feature and I have updated LaunchChangelog
License
[ ] I confirm that this pull request can be released under the Apache 2 license
Motivation and Context
When doing S3
PutObject
with flexible checksums withS3AsyncClient
, theChecksumCalculatingAsyncRequestBody
adds chunk headers and trailers to each chunk. We should skip this if there is a non-final empty chunk of length 0, as it causes an error to be thrownModifications
In
onNext()
, return theByteBuffer
as is, if it is empty and non-final chunkTesting
added unit tests, performed one-off integ 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