geyanggang commented on code in PR #13769:
URL: https://github.com/apache/gravitino/pull/13769#discussion_r4246677453
##########
catalogs/catalog-jdbc-common/src/main/java/org/apache/gravitino/catalog/jdbc/utils/DataSourceUtils.java:
##########
@@ -167,6 +167,12 @@ private static DataSource createDBCPDataSource(JdbcConfig
jdbcConfig) throws Exc
// Validate connections on borrow when enabled.
basicDataSource.setTestOnBorrow(jdbcConfig.getTestOnBorrow());
basicDataSource.setMaxWait(Duration.ofMillis(jdbcConfig.getMaxWaitMs()));
+ // Apply the driver-aware connect/socket timeout as DBCP connection
properties (not pool keys,
+ // so no collision with UNSAFE_POOL_PROPERTIES and the pool stays lazy).
These bound a single
+ // connection and take effect on the first real connection — i.e.
create-time verification — so
+ // an unreachable backend fails fast instead of hanging. Operator-set
values are preserved.
+ JdbcConnectionTimeouts.connectionProperties(jdbcConfig, jdbcUrl)
Review Comment:
Fixed by design change: we now bound only the connect timeout, not the
socket-read timeout. Normal long-running operations on existing catalogs are no
longer capped; an unreachable host still fails fast at connect.
--
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]