Error:
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: sorry, too many clients already
Warning:
com.zaxxer.hikari.pool.PoolBase(line:179) - HikariPool-1 - Failed to validate connection org.postgresql.jdbc.PgConnection@765d7657 (This connection has been closed.). Possibly consider using a shorter maxLifetime value.
Trouble shooting:
Solution:
Set a shorter maxLifetime (also idleTimeout if necessary) setMaxLifetime(N * 60 * 1000)
Or, set minimumIdle to 0 in worst case
HikariCP document to set maxLifetime for reference:
https://github.com/brettwooldridge/HikariCP?tab=readme-ov-file#gear-configuration-knobs-baby