Skip to content

fix: clarify CRT presigned URL download support - #7467

Merged
zoewangg merged 1 commit into
masterfrom
zoewang/crt-presigned-url-docs
Oct 21, 2026
Merged

zoewangg merged 1 commit into
masterfrom
zoewang/crt-presigned-url-docs

Conversation

@zoewangg

Copy link
Copy Markdown
Contributor

Motivation and Context

S3TransferManager.downloadFileWithPresignedUrl and downloadWithPresignedUrl are not supported when the transfer manager uses the AWS CRT-based S3 client. In that case the returned future completes exceptionally:

java.util.concurrent.CompletionException: java.lang.UnsupportedOperationException: Presigned URL extension is not supported for CRT client

The S3TransferManager Javadoc stated that these methods support multipart downloads with a CRT-based client, and the examples used S3TransferManager.create(). That method creates a CRT-based client when aws-crt is on the classpath, so following the examples could lead to this error. The create() Javadoc also described the non-CRT fallback as a standard S3AsyncClient.create() and said only the CRT client supports multipart transfers, but the actual fallback is a multipart-enabled S3AsyncClient.

Modifications

  • DefaultS3CrtAsyncClient.presignedUrlExtension() still throws UnsupportedOperationException, now with a clearer message: "Presigned URL downloads are not supported by the AWS CRT-based S3 client. Use a non-CRT S3AsyncClient instead, such as one built with S3AsyncClient.builder().multipartEnabled(true)."
  • S3TransferManager Javadoc:
    • downloadFileWithPresignedUrl / downloadWithPresignedUrl: multipart downloads are supported with a multipart-enabled S3 client; AWS CRT-based S3 clients are not currently supported for presigned URL downloads. The examples now build the transfer manager over S3AsyncClient.builder().multipartEnabled(true).build().
    • create() and the class-level "SDK default settings" example: describe the actual default client (CRT-based if aws-crt is on the classpath, otherwise a multipart-enabled Java-based S3 client).
    • Builder#s3Client: recommends either the CRT-based client or a multipart-enabled S3 client for multipart transfers.

Presigned URL support for the CRT-based client is not part of this change.

Testing

  • DefaultS3CrtAsyncClientTest: new test verifying presignedUrlExtension() on a CRT-based client throws UnsupportedOperationException with the new message.
  • CrtS3TransferManagerPresignedUrlDownloadTest (new): verifies that, with a CRT-based client, the completion futures of downloadFileWithPresignedUrl and downloadWithPresignedUrl fail with an UnsupportedOperationException cause. No network calls are made.
  • s3 module: mvn clean install -pl :s3 BUILD SUCCESS (1861 unit tests, 0 failures).
  • s3-transfer-manager module: mvn clean install -pl :s3-transfer-manager BUILD SUCCESS (542 unit tests, 0 failures).

A full-repo mvn install was not run.

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

  • I have read the CONTRIBUTING document
  • Local run of mvn install succeeds
  • 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

The CRT-based S3 client does not support presigned URL downloads, but
the S3TransferManager Javadoc implied it did. Correct the Javadoc and
make the CRT error message point to a multipart-enabled S3AsyncClient.
@zoewangg
zoewangg requested a review from a team as a code owner October 20, 2026 16:20
@zoewangg
zoewangg requested a review from davidh44 October 20, 2026 16:27
@zoewangg zoewangg 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 20, 2026
@zoewangg
zoewangg enabled auto-merge October 20, 2026 17:14
@zoewangg
zoewangg added this pull request to the merge queue Oct 20, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to Branch Protection failures Oct 20, 2026
You're not authorized to push to this branch. Visit "About protected branches" for more information.
@zoewangg
zoewangg added this pull request to the merge queue Oct 21, 2026
Merged via the queue into master with commit 46636fb Oct 21, 2026
20 of 22 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 21, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

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.

2 participants