Copilot commented on code in PR #49621:
URL: https://github.com/apache/doris/pull/49621#discussion_r2020717103


##########
fe/fe-core/src/main/java/org/apache/doris/datasource/iceberg/IcebergMetadataOps.java:
##########
@@ -86,6 +86,9 @@ public ExternalCatalog getExternalCatalog() {
 
     @Override
     public void close() {
+        if (catalog != null) {
+            catalog = null;

Review Comment:
   The close() method in IcebergMetadataOps only nullifies the catalog 
reference without calling a proper close method on the catalog. This may lead 
to resource leaks if the catalog holds system resources that require explicit 
closure.
   ```suggestion
               try {
                   if (catalog instanceof AutoCloseable) {
                       ((AutoCloseable) catalog).close();
                   }
               } catch (Exception e) {
                   LOG.error("Failed to close catalog", e);
               } finally {
                   catalog = null;
               }
   ```



-- 
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: commits-unsubscr...@doris.apache.org

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


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

Reply via email to