brettwooldridge / HikariCP

光 HikariCP・A solid, high-performance, JDBC connection pool at last.
Apache License 2.0
19.91k stars 2.92k forks source link

Available connections in HikariPool occassionaly drop to zero #2187

Open pxy0601 opened 7 months ago

pxy0601 commented 7 months ago

environment

hikari: 4.0.3
java: jdk1.8
database: mariadb 5.7.27-1-log
hibernate-core: 5.4.32.Final

hikari config

spring.datasource.driverClassName=org.mariadb.jdbc.Driver
spring.datasource.type=com.zaxxer.hikari.HikariDataSource
spring.datasource.hikari.minimum-idle=5
spring.datasource.hikari.maximum-pool-size=15
spring.datasource.hikari.auto-commit=true
spring.datasource.hikari.idle-timeout=30000
spring.datasource.hikari.pool-name=HikariCP
spring.datasource.hikari.max-lifetime=1800000
spring.datasource.hikari.connection-timeout=30000
spring.datasource.hikari.connection-test-query=SELECT 1

mariadb config

wait_timeout=28800s
interactive_time=28800s

logs:

total=5, active=1, idle=4, waiting=0
total=4, active=1, idle=3, waiting=0
total=4, active=1, idle=3, waiting=0
total=3, active=1, idle=2, waiting=0
total=2, active=1, idle=1, waiting=0
total=1, active=1, idle=0, waiting=0
total=0, active=0, idle=0, waiting=0
total=0, active=0, idle=0, waiting=0
total=0, active=0, idle=0, waiting=0
total=5, active=0, idle=5, waiting=0

exception:

 [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] [ERROR] - [HikariCP - Connection is not available, request timed out after 30711ms.]
rigotre7 commented 4 months ago

I have a similar issue that I mention in #2161

Were you able to figure anything out?

pxy0601 commented 4 months ago

I try using keepalive-time config to keep a heartbeat from server to database