thswlsqls opened a new pull request, #17096:
URL: https://github.com/apache/iceberg/pull/17096

   
   Closes #17095
   
   ## Summary
   
   - `newTableOps()` created a fresh `FileIO` per table load but registered it 
directly with `closeableGroup`, which never releases individual entries until 
the whole catalog closes — long-lived catalogs accumulate one `FileIO` per 
table load indefinitely.
   - Track each `FileIO` with core's `FileIOTracker` instead, matching 
`GlueCatalog#newTableOps`, which already handles the identical "new FileIO per 
TableOperations" design via `fileIOTracker.track(...)`.
   - Sibling code: 
`aws/src/main/java/org/apache/iceberg/aws/glue/GlueCatalog.java` 
(`initialize()` and `newTableOps()`).
   
   ## Testing done
   
   - Added `TestSnowflakeCatalog#testNewTableOpsTracksFileIOPerCall`, verifying 
a fresh `FileIO` is tracked on every `newTableOps()` call (including reloading 
the same table) and that all tracked `FileIO` instances close when the catalog 
closes.
   - Adjusted `TestSnowflakeCatalog#testClose` to poll for the `FileIO` close, 
since `FileIOTracker` closes tracked `FileIO` instances via an asynchronous 
removal listener.
   - `./gradlew :iceberg-snowflake:check` — 66 tests passed, 0 failures.
   


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