Copilot commented on code in PR #10255:
URL: https://github.com/apache/gravitino/pull/10255#discussion_r2889900286
##########
catalogs/catalog-jdbc-common/src/main/java/org/apache/gravitino/catalog/jdbc/JdbcCatalogOperations.java:
##########
@@ -199,6 +201,28 @@ public void close() {
metricsSystem.unregister(catalogMetricsSource);
}
DataSourceUtils.closeDataSource(dataSource);
+ try {
+ Driver driver = getDriver();
+ if (driver != null) {
+ deregisterDriver(driver);
+ }
+ } catch (Exception e) {
Review Comment:
`JdbcCatalogOperations.close()` now catches a broad `Exception`, but the
only expected checked failures here come from `getDriver()` /
`deregisterDriver()` (both `SQLException`). Catching `Exception` makes it easy
to mask unexpected programming errors during shutdown. Consider narrowing this
to `SQLException` (and optionally a separate catch for `RuntimeException` if
you want to keep shutdown best-effort) while keeping the same warning log.
```suggestion
} catch (SQLException e) {
```
--
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]