Repository navigation
fix: clarify CRT presigned URL download support - #7467
Merged
Merged
Conversation
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.
davidh44
approved these changes
Oct 20, 2026
zoewangg
enabled auto-merge
October 20, 2026 17:14
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.
|
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
S3TransferManager.downloadFileWithPresignedUrlanddownloadWithPresignedUrlare not supported when the transfer manager uses the AWS CRT-based S3 client. In that case the returned future completes exceptionally:The
S3TransferManagerJavadoc stated that these methods support multipart downloads with a CRT-based client, and the examples usedS3TransferManager.create(). That method creates a CRT-based client whenaws-crtis on the classpath, so following the examples could lead to this error. Thecreate()Javadoc also described the non-CRT fallback as a standardS3AsyncClient.create()and said only the CRT client supports multipart transfers, but the actual fallback is a multipart-enabledS3AsyncClient.Modifications
DefaultS3CrtAsyncClient.presignedUrlExtension()still throwsUnsupportedOperationException, 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)."S3TransferManagerJavadoc: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 overS3AsyncClient.builder().multipartEnabled(true).build().create()and the class-level "SDK default settings" example: describe the actual default client (CRT-based ifaws-crtis 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 verifyingpresignedUrlExtension()on a CRT-based client throwsUnsupportedOperationExceptionwith the new message.CrtS3TransferManagerPresignedUrlDownloadTest(new): verifies that, with a CRT-based client, the completion futures ofdownloadFileWithPresignedUrlanddownloadWithPresignedUrlfail with anUnsupportedOperationExceptioncause. No network calls are made.s3module:mvn clean install -pl :s3BUILD SUCCESS (1861 unit tests, 0 failures).s3-transfer-managermodule:mvn clean install -pl :s3-transfer-managerBUILD SUCCESS (542 unit tests, 0 failures).A full-repo
mvn installwas not run.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