0

I'm getting this exception in production. Things are quiet for weeks at a time and then we get a "rash" of them all of a sudden:

Caused by: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLTransientConnectionException: HikariPool-1 - Connection is not available, request timed out after 1031ms.

STEPS TAKEN TO INVESTIGATE THE PROBLEM:

This symptom has well-known possible causes, which I have checked:

What else could be causing this?

Configuration

<bean id="listingDataSource" class="com.zaxxer.hikari.HikariDataSource">
    <property name="driverClassName" value="org.postgresql.Driver" />
    <property name="jdbcUrl" value="myserver:5432/mydata?reWriteBatchedInserts=true" />
    <property name="username" value="${username}" />
    <property name="password" value="${password}" />
    <property name="minimumIdle" value="1" />
    <property name="maximumPoolSize" value="${10}" />
    <property name="connectionTimeout" value="1000" />
    <property name="leakDetectionThreshold" value="60000" />
    <property name="idleTimeout" value="120000" />
    <property name="maxLifetime" value="300000" />
</bean>
Alex R
  • 11,364
  • 15
  • 100
  • 180
  • add your configuration (do you use idle?), also there could be issue if you are using also other pool as PgBouncer https://stackoverflow.com/questions/57756239/not-able-to-open-connection-from-pgbouncer-connection-attempt-timed-out/57756405#57756405 – Ori Marko Mar 02 '22 at 13:28
  • Configuration added! – Alex R Mar 04 '22 at 16:24
  • Do you have leak warnings? Did you tried removing idle settings? – Ori Marko Mar 04 '22 at 19:34
  • There are no leak warnings. I did not try removing idle... that would increase the number of connections, I think. – Alex R Mar 05 '22 at 18:32

0 Answers0