You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@polaris.apache.org by di...@apache.org on 2026/09/22 21:54:41 UTC

(polaris) branch main updated: Migrate AWS SDK HTTP clients to Apache HttpClient 5 (#5545)

This is an automated email from the ASF dual-hosted git repository.

dimas-b pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/polaris.git


The following commit(s) were added to refs/heads/main by this push:
     new ce9e9d1032 Migrate AWS SDK HTTP clients to Apache HttpClient 5 (#5545)
ce9e9d1032 is described below

commit ce9e9d1032d60e51f1a1295224d0b996265b5f33
Author: 王一帆 <wy...@gmail.com>
AuthorDate: Wed Sep 23 05:54:35 2026 +0800

    Migrate AWS SDK HTTP clients to Apache HttpClient 5 (#5545)
    
    * Migrate AWS SDK HTTP clients to Apache HttpClient 5
    
    Replace the deprecated Apache HttpClient 4 transport dependencies and Quarkus RDS configuration with Apache HttpClient 5. Update distribution license inventories and cover the produced SDK client type.
    
    Fixes #5531
    
    * Retain Apache 4 client for Iceberg compatibility
    
    Keep the legacy AWS SDK Apache client as a runtime-only dependency while Iceberg 1.11.0 still requires it for S3 operations. Restore the packaged license entries, document the expect-continue behavior change, and remove the redundant client type test.
---
 CHANGELOG.md                                                         | 5 +++++
 runtime/admin/build.gradle.kts                                       | 4 +---
 runtime/admin/distribution/LICENSE                                   | 3 ---
 runtime/admin/src/main/resources/application.properties              | 2 +-
 runtime/defaults/src/main/resources/application.properties           | 2 +-
 runtime/service/build.gradle.kts                                     | 4 +++-
 .../java/org/apache/polaris/service/config/ServiceProducers.java     | 4 ++--
 7 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index c217eab6b3..e280beb50b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -31,6 +31,11 @@ request adding CHANGELOG notes for breaking (!) changes and possibly other secti
 
 ### Upgrade notes
 
+- Polaris-managed AWS SDK clients now use Apache HttpClient 5, which disables HTTP
+  `Expect: 100-continue` by default. Set `polaris.storage.expect-continue-enabled=true`
+  to preserve the previous behavior. Iceberg S3 clients continue to use Apache HttpClient 4
+  and retain their existing default.
+
 - Relational JDBC: schema version 6 corrects the `idx_locations` index on Postgres and CockroachDB
   (see Fixes). Fresh bootstraps use schema v6 automatically and get the right index. Because Polaris
   has no automated schema migrations, existing Postgres/CockroachDB deployments keep the old,
diff --git a/runtime/admin/build.gradle.kts b/runtime/admin/build.gradle.kts
index 27af28c786..a1bcbc9841 100644
--- a/runtime/admin/build.gradle.kts
+++ b/runtime/admin/build.gradle.kts
@@ -52,9 +52,7 @@ dependencies {
   implementation("io.quarkus:quarkus-container-image-docker")
 
   implementation(platform(libs.awssdk.bom))
-  implementation("software.amazon.awssdk:apache-client") {
-    exclude("commons-logging", "commons-logging")
-  }
+  implementation("software.amazon.awssdk:apache5-client")
 
   implementation(project(":polaris-runtime-common"))
 
diff --git a/runtime/admin/distribution/LICENSE b/runtime/admin/distribution/LICENSE
index d6f5dafaf4..0b18353c47 100644
--- a/runtime/admin/distribution/LICENSE
+++ b/runtime/admin/distribution/LICENSE
@@ -285,7 +285,6 @@ This product bundles Quarkus.
 
 * Maven group:artifact IDs: io.quarkus.arc:arc
 * Maven group:artifact IDs: io.quarkus:quarkus-agroal
-* Maven group:artifact IDs: io.quarkus:quarkus-apache-httpclient
 * Maven group:artifact IDs: io.quarkus:quarkus-arc
 * Maven group:artifact IDs: io.quarkus:quarkus-bootstrap-runner
 * Maven group:artifact IDs: io.quarkus:quarkus-classloader-commons
@@ -369,7 +368,6 @@ License: Apache License 2.0 - https://www.apache.org/licenses/LICENSE-2.0.txt
 
 This product bundles Quarkus Amazon Services.
 
-* Maven group:artifact IDs: io.quarkiverse.amazonservices:quarkus-amazon-apache-client-internal
 * Maven group:artifact IDs: io.quarkiverse.amazonservices:quarkus-amazon-apache5-client-internal
 * Maven group:artifact IDs: io.quarkiverse.amazonservices:quarkus-amazon-common
 * Maven group:artifact IDs: io.quarkiverse.amazonservices:quarkus-amazon-common-spi
@@ -1643,7 +1641,6 @@ License: Apache License 2.0 - https://www.apache.org/licenses/LICENSE-2.0.txt
 This product bundles AWS SDK for Java.
 
 * Maven group:artifact IDs: software.amazon.awssdk:annotations
-* Maven group:artifact IDs: software.amazon.awssdk:apache-client
 * Maven group:artifact IDs: software.amazon.awssdk:apache5-client
 * Maven group:artifact IDs: software.amazon.awssdk:arns
 * Maven group:artifact IDs: software.amazon.awssdk:auth
diff --git a/runtime/admin/src/main/resources/application.properties b/runtime/admin/src/main/resources/application.properties
index 6126b3f4e8..66d6095559 100644
--- a/runtime/admin/src/main/resources/application.properties
+++ b/runtime/admin/src/main/resources/application.properties
@@ -35,7 +35,7 @@ quarkus.datasource.db-kind=postgresql
 # if set to true it will try to start localstack at build and run time for the local environment
 # https://docs.quarkiverse.io/quarkus-amazon-services/dev/amazon-rds.html#_configuration_reference for more details
 quarkus.rds.devservices.enabled=false
-quarkus.rds.sync-client.type=apache
+quarkus.rds.sync-client.type=apache5
 quarkus.mongodb.devservices.enabled=false
 
 # ---- Runtime Configuration ----
diff --git a/runtime/defaults/src/main/resources/application.properties b/runtime/defaults/src/main/resources/application.properties
index 2979e52f7f..e96c754dea 100644
--- a/runtime/defaults/src/main/resources/application.properties
+++ b/runtime/defaults/src/main/resources/application.properties
@@ -160,7 +160,7 @@ polaris.secrets-manager.type=in-memory
 # if set to true it will try to start localstack at build and run time for the local environment
 # https://docs.quarkiverse.io/quarkus-amazon-services/dev/amazon-rds.html#_configuration_reference for more details
 quarkus.rds.devservices.enabled=false
-quarkus.rds.sync-client.type=apache
+quarkus.rds.sync-client.type=apache5
 
 ## MongoDB specific configuration
 #quarkus.mongodb.database=polaris
diff --git a/runtime/service/build.gradle.kts b/runtime/service/build.gradle.kts
index f9d588399e..bdac552842 100644
--- a/runtime/service/build.gradle.kts
+++ b/runtime/service/build.gradle.kts
@@ -96,7 +96,9 @@ dependencies {
   implementation("software.amazon.awssdk:s3")
   implementation("software.amazon.awssdk:kms")
   implementation("software.amazon.awssdk:cloudwatchlogs")
-  implementation("software.amazon.awssdk:apache-client") {
+  implementation("software.amazon.awssdk:apache5-client")
+  // Iceberg 1.11.0 still requires Apache 4 for its default S3 HTTP client.
+  runtimeOnly("software.amazon.awssdk:apache-client") {
     exclude("commons-logging", "commons-logging")
   }
   implementation(platform(libs.azuresdk.bom))
diff --git a/runtime/service/src/main/java/org/apache/polaris/service/config/ServiceProducers.java b/runtime/service/src/main/java/org/apache/polaris/service/config/ServiceProducers.java
index ccab75fb2a..af729e8188 100644
--- a/runtime/service/src/main/java/org/apache/polaris/service/config/ServiceProducers.java
+++ b/runtime/service/src/main/java/org/apache/polaris/service/config/ServiceProducers.java
@@ -97,7 +97,7 @@ import org.jboss.resteasy.reactive.server.core.ResteasyReactiveRequestContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import software.amazon.awssdk.http.SdkHttpClient;
-import software.amazon.awssdk.http.apache.ApacheHttpClient;
+import software.amazon.awssdk.http.apache5.Apache5HttpClient;
 
 public class ServiceProducers {
   private static final Logger LOGGER = LoggerFactory.getLogger(ServiceProducers.class);
@@ -237,7 +237,7 @@ public class ServiceProducers {
   @Singleton
   @Identifier("aws-sdk-http-client")
   public SdkHttpClient sdkHttpClient(S3AccessConfig config) {
-    ApacheHttpClient.Builder httpClient = ApacheHttpClient.builder();
+    Apache5HttpClient.Builder httpClient = Apache5HttpClient.builder();
     config.maxHttpConnections().ifPresent(httpClient::maxConnections);
     config.readTimeout().ifPresent(httpClient::socketTimeout);
     config.connectTimeout().ifPresent(httpClient::connectionTimeout);