geyanggang commented on code in PR #13769:
URL: https://github.com/apache/gravitino/pull/13769#discussion_r4246633174


##########
catalogs/catalog-jdbc-common/src/main/java/org/apache/gravitino/catalog/jdbc/config/JdbcConfig.java:
##########
@@ -114,6 +114,24 @@ public class JdbcConfig extends Config {
           .checkValue(value -> value > 0, 
ConfigConstants.POSITIVE_NUMBER_ERROR_MSG)
           .createWithDefault(30000L);
 
+  /**
+   * The canonical connect/socket timeout for a single JDBC connection, in 
milliseconds. This bounds
+   * how long a connection attempt (and a subsequent socket read) may block 
against an unreachable
+   * or unresponsive backend, so that create-time verification fails fast 
instead of hanging. It is
+   * translated to each driver family's own connection parameters (and unit) 
by {@link
+   * org.apache.gravitino.catalog.jdbc.utils.JdbcConnectionTimeouts}; an 
operator value set directly
+   * on the connection or in the {@code jdbc-url} is never overridden.
+   */
+  public static final ConfigEntry<Long> CONNECT_TIMEOUT_MS =
+      new ConfigBuilder("jdbc.pool.connect-timeout-ms")
+          .doc(
+              "The connect/socket timeout for a single JDBC connection, in 
milliseconds, "
+                  + "translated per driver so an unreachable backend fails 
fast")
+          .version(ConfigConstants.VERSION_2_0_0)
+          .longConf()
+          .checkValue(value -> value > 0, 
ConfigConstants.POSITIVE_NUMBER_ERROR_MSG)
+          .createWithDefault(30000L);

Review Comment:
   Fixed. Added jdbc.pool.connect-timeout-ms to JDBC_PROPERTIES and registered 
it as a property entry, so transformProperties retains it and it reaches 
JdbcConfig during real catalog init. Covered by a new test asserting 
propagation (value 7500 now survives, not just the default).



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