-
Notifications
You must be signed in to change notification settings - Fork 916
Do not add chunk data for empty ByteBuffer #5320
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not add chunk data for empty ByteBuffer #5320
Conversation
services/s3/pom.xml
Outdated
@@ -224,5 +224,17 @@ | |||
<artifactId>jimfs</artifactId> | |||
<scope>test</scope> | |||
</dependency> | |||
<dependency> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably avoid circular dependency in the SDK. It'll likely cause more dependency issues in the future. (Side note, I didn't know you could use exclusions trick to work around the issue)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed integ test, one-off testing and unit test should be sufficient
@@ -197,9 +197,11 @@ public void onNext(ByteBuffer byteBuffer) { | |||
checksumBytes = checksum.getChecksumBytes(); | |||
ByteBuffer allocatedBuffer = getFinalChecksumAppendedChunk(byteBuffer); | |||
wrapped.onNext(allocatedBuffer); | |||
} else { | |||
} else if (byteBuffer.remaining() > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: hasRemaining()?
|
* Do not add chunk data for empty ByteBuffer * Do not add chunk data for empty ByteBuffer * Add unit test * Add changelog * Remove integ test
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