HikariCP icon indicating copy to clipboard operation
HikariCP copied to clipboard

HikariPool - Thread starvation or clock leap detected

Open Hoainamk16 opened this issue 2 years ago • 3 comments

I'm using HikariPool Connection with myconfig : hikari: connection-timeout: 60000 #minimum-idle: 10 maximum-pool-size: 50 idle-timeout: 600000 max-lifetime: 1800000 leak-detection-threshold: 30000

And I'm getting the same error on the server every evening. After getting Thread starvation or clock leap detected (housekeeper delta=1h2m5s15ms949µs613ns). error then I can connect to my database. Please tell me what is causing this error and how to fix it? Thanks so much!

This is my log, please help me: 2021-08-13 20:16:15 [HikariPool-1 housekeeper] WARN com.zaxxer.hikari.pool.HikariPool - HikariPool-1 - Thread starvation or clock leap detected (housekeeper delta=1h2m5s15ms949µs613ns). 2021-08-13 20:16:15 [HikariPool-1 housekeeper] DEBUG com.zaxxer.hikari.pool.HikariPool - HikariPool-1 - Pool stats (total=46, active=11, idle=35, waiting=0) 2021-08-13 20:16:15 [HikariPool-1 connection adder] DEBUG com.zaxxer.hikari.pool.HikariPool - HikariPool-1 - Added connection oracle.jdbc.driver.T4CConnection@76becab1 2021-08-13 20:16:15 [HikariPool-1 connection adder] DEBUG com.zaxxer.hikari.pool.HikariPool - HikariPool-1 - Added connection oracle.jdbc.driver.T4CConnection@78793a16 2021-08-13 20:16:15 [HikariPool-1 connection adder] DEBUG com.zaxxer.hikari.pool.HikariPool - HikariPool-1 - Added connection oracle.jdbc.driver.T4CConnection@7c46a1c1 2021-08-13 20:16:15 [HikariPool-1 connection adder] DEBUG com.zaxxer.hikari.pool.HikariPool - HikariPool-1 - Added connection oracle.jdbc.driver.T4CConnection@3944302d 2021-08-13 20:16:15 [HikariPool-1 connection adder] DEBUG com.zaxxer.hikari.pool.HikariPool - HikariPool-1 - After adding stats (total=49, active=11, idle=38, waiting=0) 2021-08-13 20:16:15 [HikariPool-1 connection adder] DEBUG com.zaxxer.hikari.pool.HikariPool - HikariPool-1 - Added connection oracle.jdbc.driver.T4CConnection@392f8ef6 2021-08-13 20:16:15 [HikariPool-1 connection adder] DEBUG com.zaxxer.hikari.pool.HikariPool - HikariPool-1 - After adding stats (total=50, active=11, idle=39, waiting=0) 2021-08-13 20:28:29 [http-nio-8080-exec-20] DEBUG com.zaxxer.hikari.pool.HikariPool - HikariPool-1 - Timeout failure stats (total=50, active=11, idle=39, waiting=0) 2021-08-13 20:28:29 [http-nio-8080-exec-20] ERROR o.h.e.jdbc.spi.SqlExceptionHelper - HikariPool-1 - Connection is not available, request timed out after 928693ms.

Hoainamk16 avatar Aug 15 '21 09:08 Hoainamk16

me too

xiangdyzz avatar Mar 02 '22 12:03 xiangdyzz

The thread starvation warning specifically means that the pool hasn't been given any CPU time for the duration shown in the error.

In the above message it says 1h2m, which means that no CPU was given to the HikariCP housekeeper thread for an hour. Even on an extremely busy server this is unlikely, so the most likely cause for that specific case was that the system went into sleep mode.

lfbayer avatar Mar 02 '22 16:03 lfbayer

So the only way to get rid of this warning is to prevent the machine from going to sleep? We're using GCP's Cloud Run, and our servers run per container. To reduce cloud costs, the server goes into sleep mode if there are no external requests and we are observing this warning message.

There is no serious problem occurring, but I am very concerned because the warning message continues to appear. Can you please give me a recommended solution?

1chz avatar Apr 07 '24 13:04 1chz