zhenyangdong commented on issue #14423: URL: https://github.com/apache/iceberg/issues/14423#issuecomment-3454381253
> Setting the max idle time isn't supported in the JDBC connector, and as far as I know, the clients catalog property can only be configured within the connector itself. > > [iceberg/core/src/main/java/org/apache/iceberg/jdbc/JdbcClientPool.java](https://github.com/apache/iceberg/blob/6a0d4a0f37a22a885ef43b37353bee258ca93068/core/src/main/java/org/apache/iceberg/jdbc/JdbcClientPool.java#L58-L66) > > Lines 58 to 66 in [6a0d4a0](/apache/iceberg/commit/6a0d4a0f37a22a885ef43b37353bee258ca93068) > > public JdbcClientPool(String dbUrl, Map<String, String> props) { > this( > Integer.parseInt( > props.getOrDefault( > CatalogProperties.CLIENT_POOL_SIZE, > String.valueOf(CatalogProperties.CLIENT_POOL_SIZE_DEFAULT))), > dbUrl, > props); > } > The environment variable transform rule is explained at the following class if you are configuring `apache/iceberg-rest-fixture`: > > [iceberg/open-api/src/testFixtures/java/org/apache/iceberg/rest/RCKUtils.java](https://github.com/apache/iceberg/blob/6a0d4a0f37a22a885ef43b37353bee258ca93068/open-api/src/testFixtures/java/org/apache/iceberg/rest/RCKUtils.java#L44-L63) > > Lines 44 to 63 in [6a0d4a0](/apache/iceberg/commit/6a0d4a0f37a22a885ef43b37353bee258ca93068) > > /** > * Utility method that allows configuring catalog properties via environment variables. > * > * <p>Returns a property map for all environment variables that start with <code>CATALOG_</code> > * replacing double-underscore (<code>__</code>) with dash (<code>-</code>) and replacing single > * underscore (<code>_</code>) with dot (<code>.</code>) to allow for common catalog property > * conventions. All characters in the name are converted to lowercase and values are unmodified. > * > * <p>Examples: > * > * <pre><code> > * CATALOG_CATALOG__IMPL=org.apache.iceberg.jdbc.JdbcCatalog -> catalog-impl=org.apache.iceberg.jdbc.JdbcCatalog > * CATALOG_URI=jdbc:sqlite:memory: -> uri=jdbc:sqlite:memory: > * CATALOG_WAREHOUSE=test_warehouse -> warehouse=test_warehouse > * CATALOG_IO__IMPL=org.apache.iceberg.aws.s3.S3FileIO -> io-impl=org.apache.iceberg.aws.s3.S3FileIO > * CATALOG_JDBC_USER=ice_user -> jdbc.user=ice_user > * </code></pre> > * > * @return configuration map > */ Hi, ebyhr Thanks for reply! So how to control the jdbc connection. It occurred the problem, the DBA set the db connection idle time to 15 min, and when my iceberg catalog idle for 15 min no request, the db connections are shut down. And then I use catalog to commit my request, it report errors 'Caused by: org.postgresql.util.PSQLException: FATAL: terminating connection due to idle-session timeout' . I have researched the code like JdbcCatalog, CatalogProperties, JdbcClientPool, ClientPoolImpl etc., it makes an encapsulation on database connection , and seems no idle and expire params to control this. Any solutions? <img width="1363" height="650" alt="Image" src="https://github.com/user-attachments/assets/007a3bd8-cf70-4471-9972-396ccd551493" /> -- 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]
