Skip to content

Clarify CRT minimumPartSizeInBytes Javadoc for downloads and default sizes - #7484

Merged
adev-code merged 2 commits into
masterfrom
gh-5158-crt-part-size-javadoc
Oct 28, 2026
Merged

adev-code merged 2 commits into
masterfrom
gh-5158-crt-part-size-javadoc

Conversation

@adev-code

@adev-code adev-code commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Motivation and Context

Fixes #5158

Docs changed by this PR:

In #5158, a customer streamed large S3 objects to slow clients with AsyncResponseTransformer.toPublisher() on the CRT-based S3 client, and direct memory filled up with the file's data. Setting a smaller minimumPartSizeInBytes fixed it, because this setting also sets the part size for downloads (ranged GET requests), not only for uploads. The Javadoc doesn't say that: it only talks about upload limits and names the parameter uploadPartSize. The team agreed the documentation should clarify this, and the last comment on the issue confirms the parameter name is the remaining gap.

The Javadoc also says "By default, it is 8MB", which is no longer true for downloads. Since #6588 (first released in 2.39.6), the SDK only passes a part size to the CRT when one is set. Otherwise the CRT picks the download part size from the memory limit and target throughput (calculation in the aws-c-s3 version bundled with aws-crt-java 0.49.0).

Modifications

In S3CrtAsyncClientBuilder:

  • minimumPartSizeInBytes(Long): says the part size applies to uploads, copies and downloads (copyObject on the CRT-based client uses it for multipart copy, see DefaultS3CrtAsyncClient and CopyObjectHelper). Default: 8MB for uploads and copies, and for downloads a size the CRT chooses based on maxNativeMemoryLimitInBytes and targetThroughputInGbps. The S3 limits link now says it's guidance on part sizes. Renamed the parameter uploadPartSize to partSizeInBytes (parameter names are not part of the binary or source API, so this doesn't break callers).
  • initialReadBufferSizeInBytes(Long): default is 10 times the minimumPartSizeInBytes value, or 80MB if no part size is set, which matches S3NativeClientConfiguration.

Testing

  • Javadoc only, no behavior changes.
  • mvn install -pl :s3 with tests passes (1870 JUnit + 108 TestNG tests, 0 failures, 0 Checkstyle violations, japicmp passes; SpotBugs was skipped in this local build). Dependencies were built with -DskipTests, and the s3 tests ran with dummy AWS credentials in the environment because some tests need them.
  • javadoc -Xdoclint:all on S3CrtAsyncClientBuilder.java: no errors, and both new {@link} references resolve.

License

  • I confirm that this pull request can be released under the Apache 2 license

minimumPartSizeInBytes also sets the part size of ranged GET downloads, not
only multipart uploads. Since 2.39.6 the SDK no longer passes a default part
size to the CRT, so downloads use a part size the CRT chooses. Update the
default descriptions of minimumPartSizeInBytes and
initialReadBufferSizeInBytes, and rename the uploadPartSize parameter.

Fixes #5158
@adev-code
adev-code requested a review from a team as a code owner October 26, 2026 21:52
@adev-code adev-code added the no-api-surface-area-change Indicate there is no API surface area change and thus API surface area review is not required label Oct 26, 2026
@adev-code
adev-code requested a review from Fred1155 October 26, 2026 22:39
Review feedback on #7484: copyObject on the CRT-based client also uses this part size
for multipart copy (CopyObjectHelper, default 8MB). Docs-only changes don't need a
changelog entry.
@adev-code adev-code added the changelog-not-required Indicate changelog entry is not required for a specific PR label Oct 27, 2026
@adev-code
adev-code added this pull request to the merge queue Oct 27, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Oct 27, 2026
@adev-code
adev-code added this pull request to the merge queue Oct 27, 2026
Merged via the queue into master with commit 2417f75 Oct 28, 2026
21 of 23 checks passed
@github-actions

Copy link
Copy Markdown

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.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Oct 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

changelog-not-required Indicate changelog entry is not required for a specific PR no-api-surface-area-change Indicate there is no API surface area change and thus API surface area review is not required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Streaming of S3 large files using S3AsyncClient and AsyncResponseTransformer.toPublisher(), CRT vs netty backpressure

2 participants