nastra commented on code in PR #14161:
URL: https://github.com/apache/iceberg/pull/14161#discussion_r2382398689


##########
aws/src/main/java/org/apache/iceberg/aws/ApacheHttpClientConfigurations.java:
##########
@@ -44,7 +44,11 @@ private ApacheHttpClientConfigurations() {}
   public <T extends AwsSyncClientBuilder> void configureHttpClientBuilder(T 
awsClientBuilder) {
     ApacheHttpClient.Builder apacheHttpClientBuilder = 
ApacheHttpClient.builder();
     configureApacheHttpClientBuilder(apacheHttpClientBuilder);
-    awsClientBuilder.httpClientBuilder(apacheHttpClientBuilder);
+    // Use httpClient(<client>) method in AWS SDKv2 to prevent shared 
connection pools from closing
+    // prematurely.
+    // See:
+    // 
https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/core/client/builder/SdkAsyncClientBuilder.html#httpClient(software.amazon.awssdk.http.async.SdkAsyncHttpClient)
+    awsClientBuilder.httpClient(apacheHttpClientBuilder.build());

Review Comment:
   can you debug this and see if the HTTP client gets actually closed by 
https://github.com/apache/iceberg/blob/793f6cd062c75cc72f6ae6e42840d290cb1b68f0/aws/src/main/java/org/apache/iceberg/aws/s3/PrefixedS3Client.java#L110-L121.
 This is also where we close the S3 client and that should trigger closing the 
underlying HTTP client



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to