Postgres connection errors TCP idle connections killed

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)

Sonarqube Developer Edition

  • what are you trying to achieve

We are trying to connect to a IBM Cloud Databases for Postgres instance. But in between our Kubernetes cluster and the Postgres instance is a firewall that kills idle TCP connections every 10 minutes. So our Sonarqube instance starts fine and works for about 10-15 minutes. But as soon as there is inactivity it kills the connections and the next attempt it has to connect to the Database it throws errors and cannot complete any analysis. Logs attached

sonarqube.log (8.1 KB)

  • what have you tried so far to achieve this

We are currently running with the following environment variables and it works alright but performance could probably be better since we are essentially disabling connection pooling.


Any help on how we can set keepalive at the JDBC level? Or get around this problem while keeping pooling? Or maybe this should be moved to an enhancement request if that is not possible?