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

   ### Summary
   
   `CatalogUtil.loadFileIO` creates a `FileIO`, applies Hadoop configuration 
and storage credentials, and calls `initialize`. If any of these steps throws a 
`Exception`, the instance is never returned to the caller and any resources 
acquired during construction or setup leak.
   
   This change closes the `FileIO` instance when setup fails and rethrows the 
original exception, attaching any failure from `close()` as suppressed via 
`Exceptions.suppressExceptions`. Successful loads remain unchanged.
   
   ### Test Plan
   
   * Added `TestFileIOInitialization` covering:
     * Parameterized failure tests across `configuration`, `credentials`, and 
`initialize` verifying `fileIO.close()` is called once and the original 
exception is rethrown.
     * Suppressed exception handling when `close()` also throws during failure 
cleanup.
     * Successful initialization returning an open `FileIO` instance.
   


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