Regularly (once a week), we have to restart the server to resolve a DB connection error. Compute Engine Database Connection displays:
Pool Total Connections: 60
Pool Active Connections: 60
Pool Idle Connections: 0
Pool Max Connections: 60
Pool Min Idle Connections: 10
Pool Max Wait (ms): 8000
Pool Max Lifetime (ms): 1800000
Logs
2024.04.22 07:16:16 INFO ce[be924281-06eb-4844-b91b-afa79628fdbe][o.s.c.t.CeWorkerImpl] Executed task | project=ac.jcard.fido_4.0 | type=REPORT | id=be924281-06eb-4844-b91b-afa79628fdbe | status=FAILED | time=10018ms
2024.04.22 07:16:24 ERROR ce[][o.s.c.t.CeWorkerImpl] Call to listener ReportAnalysisFailureNotificationExecutionListener failed.
org.apache.ibatis.exceptions.PersistenceException:
### Error getting a new connection. Cause: java.sql.SQLTransientConnectionException: HikariPool-1 - Connection is not available, request timed out after 8000ms.
### Cause: java.sql.SQLTransientConnectionException: HikariPool-1 - Connection is not available, request timed out after 8000ms.
The issue does not seem to be related with the connection pool settings, but rather to the fact that DB connections seem not be released properly. As a consequence, the count of active connections grows until it reaches the total count of connections. In our case, it usually takes one week until we reach this limit and we have to restart the server to reset the counter.
Thanks