-
Notifications
You must be signed in to change notification settings - Fork 821
Update software.amazon.awssdk:* to v2.42.37 (branch_9x) - abandoned #3593
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
621984d
3dfdf1c
49f14fc
74d15a5
4cc9a00
1335185
98fb174
52a5d6e
3fd909e
e065f74
7c790d3
6beb679
e23688e
1d5d2e5
ebd2046
5122624
7922e83
409fda1
68e4c9b
f5da392
984da7c
e74d86b
82211a7
064183f
4233b85
83d69cd
543a006
2aada75
66deb79
5f19397
4f695d5
be726e0
d41b0a7
b9eb478
be27be1
9a5bb5f
6fb59a5
83c915a
5bc0fde
c0404cc
cb1bfc3
865ef83
4661f21
35ec600
e7ac003
658038b
f610af4
4003832
c84ec60
4aed807
c00f4ee
7275070
931f7ec
124654c
bd2001b
e0d99a5
ee7c6c1
dcf2849
859c54a
e004241
cd661e3
82524e1
99bdf29
1eb6d2a
62624b5
2168ab3
c85939a
eeadf45
41e5c4c
f30fdc9
ac3254e
5555f85
2b61474
271a7a1
b64906d
8bad420
ac1ba8a
a06bbf7
2851098
5bcfd21
907260d
17fdee3
78cfc7f
d368856
7b5c77d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| title: Update software.amazon.awssdk:* to v2.42.37 (branch_9x) | ||
|
||
| authors: | ||
| - name: solrbot | ||
| links: | ||
| - name: PR#3593 | ||
| url: https://github.com/apache/solr/pull/3593 | ||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| b1a13a1f1d3b5445e2f60dcc01c0e1c66662ce32 |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 34a1dcf7f2d504954b00b5d2df485b445ff0fe4a |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| dfa5f78ee3ef1ae7751d77cbfea79ab9462a4eda |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 1367486a9ad11dc1d86db7b91f1ae6763c80caa9 |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 81da5401148dc666e61137c2ec4cb6d16a1d93e9 |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| e9e2849ad9acc8ac3589d9fb77c6ba9e5e7e327c |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 495e1f5428bea389bd9bf4d431bc16445d9d6ce9 |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| b74d0ae9d5f24686f687687cf9f0fbf075eeaa63 |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 9efc58b403257390065e1dac7137a79e261df2a9 |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 4e3d8cfb9b52b94f60a91849bbfa09c0bc0f1ab9 |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 5cf2c9e67fdf32b57417f1975cdff243268e383a |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ad2b97b222ba564bc4e1f5d89a4edfe50e9bcdf8 |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 98fa9005878817a77ca4ac8bd36173e5fd7762e8 |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 443b35c30db91baad70a365c68243f0e08caf70c |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| e72436b6c5e7601f2d6172b09fe44ab5c97c33e7 |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| a6a7d757cc5c0606c725228a25c5800ef2380d5d |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| c0bcbea7717e6220421af3c320f59272e1964a25 |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| bed7e7e88026ff273838cbd40de3b9eded21e306 |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 87e9e8c04f82394aa7cb916616e1cbcfc7a954f8 |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| b2e57056153651f93a826a6e0cfc2d935d876ee3 |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 49bcc7cdf41b39b84f83f22201f888ac6d60b3e8 |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 9f2f7e54e093b5d77638b97f5fa087bbc38f7638 |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 360553c72c0e1b1949b8109bf4f202096bf3eac7 |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| de34d04f9fc382bea4b91c6e398739512db0b96e |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 1f84320b40a915b39b002bcd08247c6c4186be47 |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 07de694e0e72862f093c5c837f27fb384a6b9610 |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| e1ce18a7bb2209d6203073357e77d470c4573f06 |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 09ad8d94e91bfa5c6e2ceb0aa9b9f3201ebf9ab9 |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 0d6dc3d6fdf3404e29321698c0c7ea4b0de2c90d |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 9b862317e697a236013adbd9299174595ed279bb |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 7fbe573b0b7764ae29d2b36e63543a372c4cbbfb |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,6 +44,7 @@ | |
| import software.amazon.awssdk.core.retry.RetryMode; | ||
| import software.amazon.awssdk.core.sync.RequestBody; | ||
| import software.amazon.awssdk.core.sync.ResponseTransformer; | ||
| import software.amazon.awssdk.http.SdkHttpClient; | ||
| import software.amazon.awssdk.http.apache.ApacheHttpClient; | ||
| import software.amazon.awssdk.http.apache.ProxyConfiguration; | ||
| import software.amazon.awssdk.regions.Region; | ||
|
|
@@ -92,6 +93,9 @@ public class S3StorageClient { | |
| /** The S3 bucket where we read/write all data. */ | ||
| private final String bucketName; | ||
|
|
||
| /** The HTTP client used by the S3 client. Needs to be closed separately. */ | ||
| private final SdkHttpClient httpClient; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Claude helped me rewrite the class to manage httpClient lifecycle explicitly. |
||
|
|
||
| S3StorageClient( | ||
| String bucketName, | ||
| String profile, | ||
|
|
@@ -100,30 +104,19 @@ public class S3StorageClient { | |
| boolean proxyUseSystemSettings, | ||
| String endpoint, | ||
| boolean disableRetries) { | ||
| this( | ||
| createInternalClient( | ||
| profile, region, proxyUrl, proxyUseSystemSettings, endpoint, disableRetries), | ||
| bucketName); | ||
| this.bucketName = bucketName; | ||
| this.httpClient = createHttpClient(proxyUrl, proxyUseSystemSettings); | ||
| this.s3Client = createInternalClient(profile, region, endpoint, disableRetries, httpClient); | ||
| } | ||
|
|
||
| @VisibleForTesting | ||
| S3StorageClient(S3Client s3Client, String bucketName) { | ||
| this.s3Client = s3Client; | ||
| this.bucketName = bucketName; | ||
| this.httpClient = null; | ||
| } | ||
|
|
||
| private static S3Client createInternalClient( | ||
| String profile, | ||
| String region, | ||
| String proxyUrl, | ||
| boolean proxyUseSystemSettings, | ||
| String endpoint, | ||
| boolean disableRetries) { | ||
| S3Configuration.Builder configBuilder = S3Configuration.builder().pathStyleAccessEnabled(true); | ||
| if (StrUtils.isNotNullOrEmpty(profile)) { | ||
| configBuilder.profileName(profile); | ||
| } | ||
|
|
||
| private static SdkHttpClient createHttpClient(String proxyUrl, boolean proxyUseSystemSettings) { | ||
| ApacheHttpClient.Builder sdkHttpClientBuilder = ApacheHttpClient.builder(); | ||
| // If configured, add proxy | ||
| ProxyConfiguration.Builder proxyConfigurationBuilder = ProxyConfiguration.builder(); | ||
|
|
@@ -135,6 +128,20 @@ private static S3Client createInternalClient( | |
| sdkHttpClientBuilder.proxyConfiguration(proxyConfigurationBuilder.build()); | ||
| sdkHttpClientBuilder.useIdleConnectionReaper(false); | ||
|
|
||
| return sdkHttpClientBuilder.build(); | ||
| } | ||
|
|
||
| private static S3Client createInternalClient( | ||
| String profile, | ||
| String region, | ||
| String endpoint, | ||
| boolean disableRetries, | ||
| SdkHttpClient httpClient) { | ||
| S3Configuration.Builder configBuilder = S3Configuration.builder().pathStyleAccessEnabled(true); | ||
| if (StrUtils.isNotNullOrEmpty(profile)) { | ||
| configBuilder.profileName(profile); | ||
| } | ||
|
|
||
| /* | ||
| * Retry logic | ||
| */ | ||
|
|
@@ -167,7 +174,7 @@ private static S3Client createInternalClient( | |
| .credentialsProvider(credentialsProviderBuilder.build()) | ||
| .overrideConfiguration(builder -> builder.retryStrategy(retryStrategy)) | ||
| .serviceConfiguration(configBuilder.build()) | ||
| .httpClient(sdkHttpClientBuilder.build()); | ||
| .httpClient(httpClient); | ||
|
|
||
| if (StrUtils.isNotNullOrEmpty(endpoint)) { | ||
| clientBuilder.endpointOverride(URI.create(endpoint)); | ||
|
|
@@ -374,23 +381,27 @@ InputStream pullStream(String path) throws S3Exception { | |
| GetObjectRequest.Builder getBuilder = | ||
| GetObjectRequest.builder().bucket(bucketName).key(s3Path); | ||
| // This InputStream instance needs to be closed by the caller | ||
| return s3Client.getObject( | ||
| getBuilder.build(), | ||
| ResponseTransformer.unmanaged( | ||
| (response, inputStream) -> { | ||
| final long contentLength = response.contentLength(); | ||
| return new ResumableInputStream( | ||
| inputStream, | ||
| bytesRead -> { | ||
| if (contentLength > 0 && bytesRead >= contentLength) { | ||
| // No more bytes to read | ||
| return null; | ||
| } else if (bytesRead > 0) { | ||
| getBuilder.range(String.format(Locale.ROOT, "bytes=%d-", bytesRead)); | ||
| } | ||
| return s3Client.getObject(getBuilder.build()); | ||
| }); | ||
| })); | ||
| // Use Duration.ZERO to disable timeout and prevent response-input-stream-timeout-scheduler | ||
| // thread leak (see https://github.com/aws/aws-sdk-java-v2/issues/6567) | ||
| software.amazon.awssdk.core.ResponseInputStream< | ||
| software.amazon.awssdk.services.s3.model.GetObjectResponse> | ||
| responseStream = | ||
| s3Client.getObject( | ||
| getBuilder.build(), ResponseTransformer.toInputStream(java.time.Duration.ZERO)); | ||
| final long contentLength = responseStream.response().contentLength(); | ||
| return new ResumableInputStream( | ||
| responseStream, | ||
| bytesRead -> { | ||
| if (contentLength > 0 && bytesRead >= contentLength) { | ||
| // No more bytes to read | ||
| return null; | ||
| } else if (bytesRead > 0) { | ||
| getBuilder.range(String.format(Locale.ROOT, "bytes=%d-", bytesRead)); | ||
| } | ||
| // Use Duration.ZERO to disable timeout on resumed streams as well | ||
| return s3Client.getObject( | ||
| getBuilder.build(), ResponseTransformer.toInputStream(java.time.Duration.ZERO)); | ||
| }); | ||
| } catch (SdkException sdke) { | ||
| throw handleAmazonException(sdke); | ||
| } | ||
|
|
@@ -419,6 +430,9 @@ OutputStream pushStream(String path) throws S3Exception { | |
| /** Override {@link Closeable} since we throw no exception. */ | ||
| void close() { | ||
| s3Client.close(); | ||
| if (httpClient != null) { | ||
| httpClient.close(); | ||
| } | ||
| } | ||
|
|
||
| /** Any file path that specifies a non-existent file will not be treated as an error. */ | ||
|
|
@@ -544,7 +558,7 @@ private String getParentDirectory(String path) { | |
| } | ||
|
|
||
| /** Ensures path adheres to some rules: -Doesn't start with a leading slash */ | ||
| String sanitizedPath(String path) throws S3Exception { | ||
| String sanitizedPath(String path) { | ||
| // Trim space from start and end | ||
| String sanitizedPath = path.trim(); | ||
|
|
||
|
|
@@ -580,7 +594,7 @@ String sanitizedFilePath(String path) throws S3Exception { | |
| * Ensures directory path adheres to some rules: -Overall Path rules from `sanitizedPath` -Add a | ||
| * trailing slash if one does not exist | ||
| */ | ||
| String sanitizedDirPath(String path) throws S3Exception { | ||
| String sanitizedDirPath(String path) { | ||
| // Trim space from start and end | ||
| String sanitizedPath = sanitizedPath(path); | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR description’s dependency table indicates an update from 2.31.77 -> 2.35.10, but the actual changes in this PR bump the AWS SDK BOM/wildcard to 2.42.37. Please update the PR description (or regenerate) so reviewers and release notes match the real version being introduced.