Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
621984d
Update software.amazon.awssdk:* to v2.35.10 (branch_9x)
solrbot Oct 23, 2025
3dfdf1c
Add changelog entry
solrbot Jan 2, 2026
49f14fc
v2.41.0
janhoy Jan 3, 2026
74d15a5
Add changelog entry
solrbot Jan 3, 2026
4cc9a00
Remove double changelog file
janhoy Jan 3, 2026
1335185
Add import, fix some test bugs
janhoy Jan 3, 2026
98fb174
Update changelog entry
solrbot Apr 21, 2026
52a5d6e
SOLR-18032 Docker gradle build support multi-platform (#3964)
janhoy Dec 22, 2025
3fd909e
Fix failing errorprone rule in FilterFunctionTest.java
janhoy Jan 6, 2026
e065f74
SOLR-18032 Use SOLR_DOCKER_PLATFORM only for dockerPush command (#3973)
janhoy Dec 22, 2025
7c790d3
Replace HTTP-method string-handling with enum
gerlowskija Jan 6, 2026
6beb679
Remove faulty override of renovate packageRules
janhoy Jan 6, 2026
e23688e
Run --write-locks in renovate for branch_9x
janhoy Jan 6, 2026
1d5d2e5
Update actions/cache action to v5 (branch_9x) (#4030)
solrbot Jan 6, 2026
ebd2046
Update actions/upload-artifact action to v6 (branch_9x) (#4031)
solrbot Jan 6, 2026
5122624
SOLR-17438: Remove 'json' from requirements.txt
gerlowskija Jan 8, 2026
7922e83
Logchange release on branch_9_10 - rm changelog/unreleased
gerlowskija Jan 8, 2026
409fda1
Logchange release on branch_9_10 - add changelog/v9.10.1
gerlowskija Jan 8, 2026
68e4c9b
CHANGELOG.md generated for release v9.10.1
gerlowskija Jan 8, 2026
f5da392
SOLR-17947: CloudSolrClient refreshes collection state asynchronously…
HoustonPutman Jan 9, 2026
984da7c
Add changelog release-date for v9.10.0
janhoy Jan 9, 2026
e74d86b
SOLR-18058: Tweak "allowPath" checks to avoid NPEs
gerlowskija Jan 9, 2026
82211a7
Fix 'path' and 'permission' related NPEs
gerlowskija Jan 14, 2026
064183f
DOAP changes for release 9.10.1
gerlowskija Jan 20, 2026
4233b85
Fix changelog inconsistencies following 9.10.1 release
gerlowskija Jan 21, 2026
83d69cd
Fix build breakage on Windows (#4072)
rahulgoswami Jan 22, 2026
543a006
--cloud option is not honored when running example (-e) on Windows (#…
rahulgoswami Jan 23, 2026
2aada75
SOLR-18051: HttpJettySolrClient.requestAsync performance/reliability …
jvanneman Jan 25, 2026
66deb79
SOLR-12224: Add APIs to read collection properties (#4071)
gerlowskija Jan 26, 2026
5f19397
Backport SOLR-18008 to 9x (#4086)
epugh Jan 28, 2026
4f695d5
SOLR-18071: Support stored fields in ExportWriter (#4053)
kotman12 Jan 31, 2026
be726e0
modules/analytics: build.gradle: warnings shouldn't error
dsmiley Jan 31, 2026
d41b0a7
SOLR-18096: /admin/cores?action=UPGRADECOREINDEX (#3903)
rahulgoswami Feb 1, 2026
b9eb478
SOLR-18073 JWT Authentication plugin now supports matching non-string…
janhoy Feb 4, 2026
be27be1
Improve writeChangelog gradle task (#4007)
janhoy Feb 4, 2026
9a5bb5f
SOLR-18076 Agents.md for solr (#4103)
janhoy Feb 12, 2026
6fb59a5
Add AI coding agents to gitignore (#4104)
janhoy Feb 12, 2026
83c915a
build, GHA workflow: remove DEVELOCITY_ACCESS_KEY (#4077)
dsmiley Feb 7, 2026
5bc0fde
New gradle runDev alternative to "dev" (#3816)
dsmiley Nov 7, 2025
c0404cc
SOLR-18107: Test fix testLogLevelHandlerOutput (#4146)
dsmiley Feb 21, 2026
cb1bfc3
SOLR-18056: CloudSolrClient better urlScheme detection (from URL or s…
VishnuPriyaChandraSekar Feb 27, 2026
865ef83
Default to MockDirectoryFactory in test configs (#2598)
gerlowskija Jul 30, 2024
4661f21
SOLR-18142: Fix CloudSolrClient cache state refresh; regression. (#4176)
dsmiley Mar 7, 2026
35ec600
SOLR-18146: Fix race in CircuitBreakerRegistry (#4189)
gerlowskija Mar 9, 2026
e7ac003
SOLR-18144: fix schema designer to auto-create .system in 9x (#4202)
dsmiley Mar 12, 2026
658038b
SOLR-18155: Abort shard leader election if container shutdown has sta…
psalagnac Mar 18, 2026
f610af4
SOLR-18157: Optimize buffer allocation in JavaBinCodec (#4208)
psalagnac Mar 19, 2026
4003832
SOLR-18089: Configure zookeeper.maxCnxns for embedded ZkServer (#4173)
openworld-maker Mar 9, 2026
c84ec60
ZkTestServer: log.error -> log.warn for 'stat'
dsmiley Mar 13, 2026
4aed807
SOLR-17973: Fix `shards.preference` not respected for cross-collectio…
KhushJain Mar 18, 2026
c00f4ee
TikaServerExtractionBackendTest: ignore on s390x
dsmiley Mar 18, 2026
7275070
SOLR-18136: fix multiThreaded=true with rerank & sort (#4164)
limingnihao Mar 19, 2026
931f7ec
Benchmark fixes (#4194)s
dsmiley Mar 20, 2026
124654c
[SOLR-18114] CloudSolrClient fails deleteById with directUpdatesToLea…
mlbiscoc Mar 26, 2026
bd2001b
Add clean to cherrypick.sh before runnign (precommit) check (#4238)
janhoy Mar 26, 2026
e0d99a5
Fix a broken refguide link
janhoy Mar 26, 2026
ee7c6c1
[NO-JIRA] analyzeClassesDependencies failure from unused org.apache.h…
mlbiscoc Mar 26, 2026
dcf2849
Solr Admin Ui: search with contains in solr core/collection drop down…
renatoh Mar 27, 2026
859c54a
build: GHA: sync from main (#4242)
dsmiley Mar 28, 2026
e004241
Fix for defect SOLR-18186: Solr heap used percentage uses committed h…
raviranjanjha Apr 6, 2026
cd661e3
SOLR-18176: HttpShardHandler query throughput bottleneck from ZooKeep…
mlbiscoc Apr 9, 2026
82524e1
SOLR-17353 Remove gosu binary from the Docker image (#4285) (branch_9…
janhoy Apr 16, 2026
99bdf29
SOLR-18192: Pin all GitHub Actions to full commit SHAs as per ASF pol…
janhoy Apr 18, 2026
1eb6d2a
SOLR 18174 AsyncTracker Semaphore permit leak fix (branch_9x) (#4292)
janhoy Apr 20, 2026
62624b5
Update actions/upload-artifact action to v7 (branch_9x) (#4306)
solrbot Apr 21, 2026
2168ab3
Update dependency org.jctools:jctools-core to v4.0.6 (branch_9x) (#4297)
solrbot Apr 22, 2026
c85939a
Update dependency org.apache.commons:commons-exec to v1.6.0 (branch_9…
solrbot Apr 22, 2026
eeadf45
Update dependency org.apache.commons:commons-configuration2 to v2.14.…
solrbot Apr 22, 2026
41e5c4c
Update dependency org.apache.commons:commons-lang3 to v3.20.0 (branch…
solrbot Apr 22, 2026
f30fdc9
Update org.apache.kafka:* to v3.9.2 (branch_9x) (#4298)
solrbot Apr 22, 2026
ac3254e
Update org.apache.logging.log4j:* to v2.25.4 (branch_9x) (#4299)
solrbot Apr 22, 2026
5555f85
Update org.apache.zookeeper:* to v3.9.5 (branch_9x) (#4300)
solrbot Apr 22, 2026
2b61474
Update org.mockito:mockito* to v5.23.0 (branch_9x) (#3723)
solrbot Apr 22, 2026
271a7a1
Update dependency com.github.ben-manes.caffeine:caffeine to v3.2.3 (b…
solrbot Apr 22, 2026
b64906d
Update io.netty:netty* to v4.2.12.Final (branch_9x) (#4026)
solrbot Apr 22, 2026
8bad420
Update org.apache.tika:* to v3.3.0 (branch_9x) (#4302)
solrbot Apr 22, 2026
ac1ba8a
Update io.dropwizard.metrics:* to v4.2.38 (branch_9x) (#3529)
solrbot Apr 22, 2026
a06bbf7
Update software.amazon.awssdk:* to v2.35.10 (branch_9x)
solrbot Oct 23, 2025
2851098
v2.41.0
janhoy Jan 3, 2026
5bcfd21
Update software.amazon.awssdk:* to v2.42.37 (branch_9x)
Apr 22, 2026
907260d
Update changelog entry
solrbot Apr 22, 2026
17fdee3
Merge branch 'branch_9x' into renovate-9x/software.amazon.awssdk
janhoy Apr 22, 2026
78cfc7f
Merge remote-tracking branch 'solrbot/renovate-9x/software.amazon.aws…
janhoy Apr 22, 2026
d368856
Update PR#3593-update-software-amazon-awssdk-to-v2-41-0-branch.yml
janhoy Apr 22, 2026
7b5c77d
Update PR#3593-update-software-amazon-awssdk-to-v2-41-0-branch.yml
janhoy Apr 22, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
Copy link

Copilot AI Apr 22, 2026

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.

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changelog entry filename still says "...to-v2-41-0..." but the entry title (and the actual dependency bump) is to 2.42.37. Please rename this changelog YAML file to match the version being released to avoid confusion when scanning unreleased entries.

Copilot uses AI. Check for mistakes.
authors:
- name: solrbot
links:
- name: PR#3593
url: https://github.com/apache/solr/pull/3593
1 change: 0 additions & 1 deletion solr/licenses/annotations-2.31.77.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions solr/licenses/annotations-2.42.37.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
b1a13a1f1d3b5445e2f60dcc01c0e1c66662ce32
1 change: 0 additions & 1 deletion solr/licenses/apache-client-2.31.77.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions solr/licenses/apache-client-2.42.37.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
34a1dcf7f2d504954b00b5d2df485b445ff0fe4a
1 change: 0 additions & 1 deletion solr/licenses/arns-2.31.77.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions solr/licenses/arns-2.42.37.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dfa5f78ee3ef1ae7751d77cbfea79ab9462a4eda
1 change: 0 additions & 1 deletion solr/licenses/auth-2.31.77.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions solr/licenses/auth-2.42.37.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1367486a9ad11dc1d86db7b91f1ae6763c80caa9
1 change: 0 additions & 1 deletion solr/licenses/aws-core-2.31.77.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions solr/licenses/aws-core-2.42.37.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
81da5401148dc666e61137c2ec4cb6d16a1d93e9
1 change: 0 additions & 1 deletion solr/licenses/aws-query-protocol-2.31.77.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions solr/licenses/aws-query-protocol-2.42.37.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
e9e2849ad9acc8ac3589d9fb77c6ba9e5e7e327c
1 change: 0 additions & 1 deletion solr/licenses/aws-xml-protocol-2.31.77.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions solr/licenses/aws-xml-protocol-2.42.37.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
495e1f5428bea389bd9bf4d431bc16445d9d6ce9
1 change: 0 additions & 1 deletion solr/licenses/checksums-2.31.77.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions solr/licenses/checksums-2.42.37.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
b74d0ae9d5f24686f687687cf9f0fbf075eeaa63
1 change: 0 additions & 1 deletion solr/licenses/checksums-spi-2.31.77.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions solr/licenses/checksums-spi-2.42.37.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9efc58b403257390065e1dac7137a79e261df2a9
1 change: 0 additions & 1 deletion solr/licenses/crt-core-2.31.77.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions solr/licenses/crt-core-2.42.37.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4e3d8cfb9b52b94f60a91849bbfa09c0bc0f1ab9
1 change: 0 additions & 1 deletion solr/licenses/endpoints-spi-2.31.77.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions solr/licenses/endpoints-spi-2.42.37.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5cf2c9e67fdf32b57417f1975cdff243268e383a
1 change: 0 additions & 1 deletion solr/licenses/http-auth-2.31.77.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions solr/licenses/http-auth-2.42.37.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ad2b97b222ba564bc4e1f5d89a4edfe50e9bcdf8
1 change: 0 additions & 1 deletion solr/licenses/http-auth-aws-2.31.77.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions solr/licenses/http-auth-aws-2.42.37.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
98fa9005878817a77ca4ac8bd36173e5fd7762e8
1 change: 0 additions & 1 deletion solr/licenses/http-auth-aws-eventstream-2.31.77.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions solr/licenses/http-auth-aws-eventstream-2.42.37.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
443b35c30db91baad70a365c68243f0e08caf70c
1 change: 0 additions & 1 deletion solr/licenses/http-auth-spi-2.31.77.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions solr/licenses/http-auth-spi-2.42.37.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
e72436b6c5e7601f2d6172b09fe44ab5c97c33e7
1 change: 0 additions & 1 deletion solr/licenses/http-client-spi-2.31.77.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions solr/licenses/http-client-spi-2.42.37.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
a6a7d757cc5c0606c725228a25c5800ef2380d5d
1 change: 0 additions & 1 deletion solr/licenses/identity-spi-2.31.77.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions solr/licenses/identity-spi-2.42.37.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
c0bcbea7717e6220421af3c320f59272e1964a25
1 change: 0 additions & 1 deletion solr/licenses/json-utils-2.31.77.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions solr/licenses/json-utils-2.42.37.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bed7e7e88026ff273838cbd40de3b9eded21e306
1 change: 0 additions & 1 deletion solr/licenses/metrics-spi-2.31.77.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions solr/licenses/metrics-spi-2.42.37.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
87e9e8c04f82394aa7cb916616e1cbcfc7a954f8
1 change: 0 additions & 1 deletion solr/licenses/profiles-2.31.77.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions solr/licenses/profiles-2.42.37.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
b2e57056153651f93a826a6e0cfc2d935d876ee3
1 change: 0 additions & 1 deletion solr/licenses/protocol-core-2.31.77.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions solr/licenses/protocol-core-2.42.37.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
49bcc7cdf41b39b84f83f22201f888ac6d60b3e8
1 change: 0 additions & 1 deletion solr/licenses/regions-2.31.77.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions solr/licenses/regions-2.42.37.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9f2f7e54e093b5d77638b97f5fa087bbc38f7638
1 change: 0 additions & 1 deletion solr/licenses/retries-2.31.77.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions solr/licenses/retries-2.42.37.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
360553c72c0e1b1949b8109bf4f202096bf3eac7
1 change: 0 additions & 1 deletion solr/licenses/retries-spi-2.31.77.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions solr/licenses/retries-spi-2.42.37.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
de34d04f9fc382bea4b91c6e398739512db0b96e
1 change: 0 additions & 1 deletion solr/licenses/s3-2.31.77.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions solr/licenses/s3-2.42.37.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1f84320b40a915b39b002bcd08247c6c4186be47
1 change: 0 additions & 1 deletion solr/licenses/sdk-core-2.31.77.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions solr/licenses/sdk-core-2.42.37.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
07de694e0e72862f093c5c837f27fb384a6b9610
1 change: 0 additions & 1 deletion solr/licenses/sts-2.31.77.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions solr/licenses/sts-2.42.37.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
e1ce18a7bb2209d6203073357e77d470c4573f06
1 change: 0 additions & 1 deletion solr/licenses/third-party-jackson-core-2.31.77.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions solr/licenses/third-party-jackson-core-2.42.37.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
09ad8d94e91bfa5c6e2ceb0aa9b9f3201ebf9ab9
1 change: 0 additions & 1 deletion solr/licenses/url-connection-client-2.31.77.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions solr/licenses/url-connection-client-2.42.37.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0d6dc3d6fdf3404e29321698c0c7ea4b0de2c90d
1 change: 0 additions & 1 deletion solr/licenses/utils-2.31.77.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions solr/licenses/utils-2.42.37.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9b862317e697a236013adbd9299174595ed279bb
1 change: 1 addition & 0 deletions solr/licenses/utils-lite-2.42.37.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7fbe573b0b7764ae29d2b36e63543a372c4cbbfb
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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,
Expand All @@ -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();
Expand All @@ -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
*/
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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. */
Expand Down Expand Up @@ -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();

Expand Down Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import software.amazon.awssdk.core.sync.RequestBody;
import software.amazon.awssdk.core.sync.ResponseTransformer;
import software.amazon.awssdk.regions.Region;
import software.amazon.awssdk.services.s3.S3Client;

Expand Down Expand Up @@ -107,18 +108,18 @@ public void testLocalDirectoryFunctions() throws Exception {
repo.createDirectory(path);
assertTrue(repo.exists(path));
assertEquals(BackupRepository.PathType.DIRECTORY, repo.getPathType(path));
assertEquals("No files should exist in dir yet", repo.listAll(path).length, 0);
assertEquals("No files should exist in dir yet", 0, repo.listAll(path).length);

URI subDir = new URI("/test/dir/");
repo.createDirectory(subDir);
assertTrue(repo.exists(subDir));
assertEquals(BackupRepository.PathType.DIRECTORY, repo.getPathType(subDir));
assertEquals("No files should exist in subdir yet", repo.listAll(subDir).length, 0);
assertEquals("No files should exist in subdir yet", 0, repo.listAll(subDir).length);

assertEquals(
"subDir should now be returned when listing all in parent dir",
repo.listAll(path).length,
1);
1,
repo.listAll(path).length);

repo.deleteDirectory(path);
assertFalse(repo.exists(path));
Expand Down Expand Up @@ -338,7 +339,10 @@ private void pushObject(String path, String content) {
private File pullObject(String path) throws IOException {
try (S3Client s3 = S3_MOCK_RULE.createS3ClientV2()) {
File file = temporaryFolder.newFile();
InputStream input = s3.getObject(b -> b.bucket(BUCKET_NAME).key(path));
InputStream input =
s3.getObject(
b -> b.bucket(BUCKET_NAME).key(path),
ResponseTransformer.toInputStream(java.time.Duration.ZERO));
FileUtils.copyInputStreamToFile(input, file);
return file;
}
Expand Down
Loading
Loading