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


##########
core/src/main/java/org/apache/iceberg/rest/RESTTableScan.java:
##########
@@ -58,6 +61,17 @@ class RESTTableScan extends DataTableScan {
   private static final long MAX_WAIT_TIME_MS = 5 * 60 * 1000; // Total maximum 
duration (5 minutes)
   private static final double SCALE_FACTOR = 2.0; // Exponential scale factor
   private static final String DEFAULT_FILE_IO_IMPL = 
"org.apache.iceberg.io.ResolvingFileIO";
+  private static final Cache<RESTTableScan, FileIO> TRACKER =
+      Caffeine.newBuilder()
+          .weakKeys()
+          .removalListener(
+              (RemovalListener<RESTTableScan, FileIO>)
+                  (scan, io, cause) -> {
+                    if (null != io) {
+                      io.close();

Review Comment:
   we do have a bunch of other places where we are not doing a `closeQuietly` 
like in 
https://github.com/apache/iceberg/blob/cf02ffac4329141b30bca265cafb9987f64f6cc4/core/src/main/java/org/apache/iceberg/io/FileIOTracker.java#L41-L45
 so at the very least we might want to adjust this across the codebase if we 
want to close this via `closeQuietly`. Let me get this one merged and then we 
can decide whether we want to update this across the codebase



-- 
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