HikariPool-1 - Connection marked as broken because of SQLSTATE(08S01), ErrorCode(-99999)

Anders Metnik picture Anders Metnik · Feb 21, 2019 · Viewed 15.7k times · Source
HikariPool-1 - Connection marked as broken because of SQLSTATE(08S01), ErrorCode(-99999)
java.sql.SQLNonTransientConnectionException: Communication link failure. (Read timed out)

I kept getting this problem, when creating a table with data, which was about 6million records. On ACS, an sql developer, it took around 1½ minute.

Answer

Anders Metnik picture Anders Metnik · Feb 21, 2019

I found out that default connection validation (spring.datasource.hikari.validationTimeout) was set to 5000 (5 seconds).
This lead to hikari, not being able to validate the connection, because it was busy for long time. Solution was setting this property to a high enough number (i set it to 5minutes - 300000)