Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

connectionTimeout property is not propagated to Postgres driver creating the connection #2202

Open
Jeaksen opened this issue May 22, 2024 · 0 comments

Comments

@Jeaksen
Copy link

Jeaksen commented May 22, 2024

I'm using HikariCP 5.1.0 and Postgres driver org.postgresql:postgresql:42.6.2.

The HikariConfig.connectionTimeout property is not passed on to the driver - setting the timeout has no effect on the final connection timeout.

image

After some debugging I found that the driver is trying to fetch "loginTimeout" property from the Properties object that is passed to the driver, but that property is never set. During PoolBase initialization the setLoginTimeout method is calling DriverDataSource implementation, which calls DriverManager.setLoginTimeout(seconds), however, the Postgres driver doesn't use this value.

I tested this with an Oracle driver com.oracle.database.jdbc:ojdbc8:21.9.0.0. In that case the property works fine.

For now I made I quick hack for Postgres and during pool configuration I added this line:
hikariConfig.addDataSourceProperty("loginTimeout", 3);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant