rajdchak commented on code in PR #12891:
URL: https://github.com/apache/iceberg/pull/12891#discussion_r2058527214


##########
aws/src/main/java/org/apache/iceberg/aws/s3/AnalyticsAcceleratorUtil.java:
##########
@@ -83,6 +95,16 @@ private static S3SeekableInputStreamFactory createNewFactory(
     return new S3SeekableInputStreamFactory(objectClient, streamConfiguration);
   }
 
+  private static void handleRemoval(S3SeekableInputStreamFactory factory) {
+    if (factory != null) {
+      try {
+        factory.close();
+      } catch (IOException e) {
+        LOG.warn("Failed to close S3SeekableInputStreamFactory", e);
+      }
+    }
+  }
+
   public static void cleanupCache(
       S3AsyncClient asyncClient, S3FileIOProperties s3FileIOProperties) {
     STREAM_FACTORY_CACHE.invalidate(Pair.of(asyncClient, s3FileIOProperties));

Review Comment:
   before invalidating the factories from the cache also we should close the 
factories.



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to