Add validation for buffer lengthwhen multipart upload with unknown contentlength#7024
Merged
Merged
Conversation
davidh44
approved these changes
Jun 9, 2026
|
|
||
| verifyFailureWithMessage(future, "must be at least 2 x minimumPartSizeInBytes"); | ||
|
|
||
| verify(asyncRequestBody, times(0)).splitCloseable(any(Consumer.class)); |
Contributor
There was a problem hiding this comment.
nit nonblocking: never() instead of times(0)
| * Default value: If not specified, the SDK will use the equivalent of four parts worth of memory, so 32 Mib by default. | ||
| * <p> | ||
| * When uploading content with an unknown content length, this value | ||
| * must be at least 2 x {@code minimumPartSizeInBytes}. The unknown-length upload path buffers one part while it buffers |
Contributor
There was a problem hiding this comment.
nit nonblocking: {@link #minimumPartSizeInBytes} instead
zoewangg
approved these changes
Jun 9, 2026
|
This pull request has been closed and the conversation has been locked. Comments on closed PRs are hard for our team to see. If you need more assistance, please open a new issue that references this one. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Motivation and Context
S3 multipart uploads with unknown content length could hang when apiCallBufferSizeInBytes was less than 2 × minimumPartSizeInBytes. The unknown-length path holds the first part in memory while buffering the second, so it needs room for two parts; a smaller buffer causes a circular wait before any HTTP request is made, so no timeout applies.
Modifications
Testing
Added unit test and ran local integration test.
Screenshots (if appropriate)
Types of changes
Checklist
mvn installsucceedsscripts/new-changescript and following the instructions. Commit the new file created by the script in.changes/next-releasewith your changes.License