Copilot commented on code in PR #14485:
URL: https://github.com/apache/gravitino/pull/14485#discussion_r4438822112


##########
catalogs/catalog-jdbc-common/src/main/java/org/apache/gravitino/catalog/jdbc/utils/DataSourceUtils.java:
##########
@@ -88,51 +89,68 @@ public static DataSource createDataSource(JdbcConfig 
jdbcConfig)
     // config to the factory. Kept outside the try below so the specific 
reason surfaces directly
     // instead of being wrapped as "Error creating datasource".
     rejectUnsafePoolProperties(jdbcConfig.getAllConfig());
+    // Validate user configuration before the data-source builder wraps 
infrastructure failures.
+    jdbcConfig.getVerifyOnCreate();
+    jdbcConfig.getTestOnBorrow();
+    jdbcConfig.getConnectTimeoutMs();
+    jdbcConfig.getMaxWaitMs();

Review Comment:
   These checks run only when JDBC operations are initialized, so creating a 
catalog with `verify-on-create=false` and `jdbc-driver=java.lang.String` still 
accepts and persists invalid settings. Catalog alteration also skips 
initialization, allowing invalid connection settings to persist until a later 
data operation fails. Run configuration-only validation on the create and alter 
paths independently of the optional backend probe, preserving unsafe-URL checks 
before driver instantiation.



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

Reply via email to