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: [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]