Repository navigation
Fix AsyncRequestBody split overflow and error propagation - #7521
Open
jencymaryjoseph wants to merge 3 commits into
Open
jencymaryjoseph wants to merge 3 commits into
jencymaryjoseph wants to merge 3 commits into
Conversation
jencymaryjoseph
force-pushed
the
jencyjos/bugfix/large-chunk-split
branch
from
November 6, 2026 04:54
c01a0cb to
9875ee3
Compare
Keep logical chunk remainder calculations as long so split part sizes above Integer.MAX_VALUE do not fail while processing int-sized ByteBuffers. Centralize splitter failure handling and prevent upstream request or cancel calls from upstream terminal callbacks. Add boundary, error-path, and Reactive Streams TCK coverage.
jencymaryjoseph
force-pushed
the
jencyjos/bugfix/large-chunk-split
branch
from
November 6, 2026 04:55
9875ee3 to
a61ba03
Compare
dagnir
reviewed
Nov 6, 2026
| "type": "bugfix", | ||
| "category": "AWS SDK for Java v2", | ||
| "contributor": "", | ||
| "description": "Fixed AsyncRequestBody splitting for chunk sizes larger than 2 GiB and propagated splitter failures through onError." |
Contributor
There was a problem hiding this comment.
Can we make this message more customer facing? i.e. this means that if customers try to upload with min part sizes of 2GiB or more through the multipart client or TM, it should work now right?
Contributor
Author
There was a problem hiding this comment.
Yes, multipart uploads through the S3 multipart client or Transfer Manager can now use minimum part sizes of 2 GiB or larger, up to S3’s 5GB maximum. Updated the change log message
This branch has not been deployed
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.
Motivation and Context
AsyncRequestBody.splitandsplitCloseableuseSplittingPublisherto divide one streaming request body into logical parts, such as the parts used by multipart uploads. The data for each logical part arrives as one or moreByteBufferobjects.This change fixes two issues in that flow:
1. Logical part sizes larger than an
intfailedSplittingPublishercalculated the number of bytes remaining in the current logical part as anint:Both values are
long, and a logical multipart part can be larger thanInteger.MAX_VALUE. Converting the result to anintcaused anArithmeticExceptionfor part sizes such as 5 GiB, even though each individualByteBufferwas small enough to use normalint-based buffer positions and limits.2. Terminal error handling could call the upstream subscription
Splitter failures were handled through several separate paths. While processing upstream
onErrororonComplete, propagating a terminal signal could synchronously trigger another call toSubscription.cancel()orSubscription.request(...). Reactive Streams rule 2.3 prohibits calling methods on the upstream subscription from these terminal callbacks.Failures could also escape directly instead of being consistently delivered to both the active split request body and the outer publisher through
onError.Modifications
amountRemainingInChunkas alongwhile comparing and tracking logical part sizes.intonly when it is used to select a position inside oneByteBuffer. At that point, the preceding comparisons guarantee that the value is smaller thanbyteBuffer.remaining()and therefore fits in anint.failStreampath that:onErrororonCompletehas started, and prevent direct or consumption-triggered upstream requests after that point.onSubscribe,onNext, andonError.PublisherVerificationTCK suite forSplittingPublisher.Testing
The regression coverage includes:
Integer.MAX_VALUE,Integer.MAX_VALUE + 1, and 5 GiB;splitandsplitCloseable;requestandcancelare not invoked from terminal callbacks;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