Hi,
We recently upgraded our SonarQube installation to Enterprise EditionVersion 10.4 (build 87286)
and were running the 10.3 version before.
It is deployed on a Kubernetes cluster and connected to an AWS RDS PostgreSQL database with the following plugins:
insideapp-oss/sonar-flutter 0.5.0
galexandre/sonar-cobertura latest
checkstyle/sonar-checkstyle latest
stefanrinderle/softvis3d latest
willemsrb/sonar-rci-plugin latest
willemsrb/sonar-jdepend-plugin latest
Inform-Software/sonar-groovy latest
jborgers/sonar-pmd latest
Resulting in, at the moment:
Checkstyle 10.12.5
Cobertura 2.0
Flutter 0.5.0
Groovy 1.8
Rules Compliance Index (RCI) 1.0.2
SoftVis3D 1.3.0
jDepend 1.1.1
Since the upgrade, SonarQube seems to leak DB connections, or at least keep them alive where it should not.
On the attached picture, we got near to 161 opened connections while there was no more analysis in progress.
We updated our configuration to tweak a bit the Hikari pool, but connections still aren’t released as expected.
We were using the default Database configuration for the Hikari pool before, now here is our current configuration:
INFO ce[][o.s.d.DefaultDatabase] Create JDBC data source for jdbc:postgresql://sonar.example.com:5432/sonarDB?ssl=true&sslmode=verify-ca&sslrootcert=/path/to/cert
DEBUG ce[][c.z.h.HikariConfig] Driver class org.postgresql.Driver found in Thread context class loader jdk.internal.loader.ClassLoaders$AppClassLoader@75700fee
WARN ce[][c.z.h.HikariConfig] HikariPool-1 - keepaliveTime is greater than or equal to maxLifetime, disabling it.
DEBUG ce[][c.z.h.HikariConfig] HikariPool-1 - configuration:
DEBUG ce[][c.z.h.HikariConfig] allowPoolSuspension.............false
DEBUG ce[][c.z.h.HikariConfig] autoCommit......................true
DEBUG ce[][c.z.h.HikariConfig] catalog.........................none
DEBUG ce[][c.z.h.HikariConfig] connectionInitSql..............."SET standard_conforming_strings=on"
DEBUG ce[][c.z.h.HikariConfig] connectionTestQuery............."SELECT 1"
DEBUG ce[][c.z.h.HikariConfig] connectionTimeout...............8000
DEBUG ce[][c.z.h.HikariConfig] dataSource......................none
DEBUG ce[][c.z.h.HikariConfig] dataSourceClassName.............none
DEBUG ce[][c.z.h.HikariConfig] dataSourceJNDI..................none
DEBUG ce[][c.z.h.HikariConfig] dataSourceProperties............{password=<masked>, user=pgssonp1}
DEBUG ce[][c.z.h.HikariConfig] driverClassName................."org.postgresql.Driver"
DEBUG ce[][c.z.h.HikariConfig] exceptionOverrideClassName......none
DEBUG ce[][c.z.h.HikariConfig] healthCheckProperties...........{}
DEBUG ce[][c.z.h.HikariConfig] healthCheckRegistry.............none
DEBUG ce[][c.z.h.HikariConfig] idleTimeout.....................120000
DEBUG ce[][c.z.h.HikariConfig] initializationFailTimeout.......1
DEBUG ce[][c.z.h.HikariConfig] isolateInternalQueries..........false
DEBUG ce[][c.z.h.HikariConfig] jdbcUrl.........................jdbc:postgresql://sonar.example.com:5432/sonarDB?ssl=true&sslmode=verify-ca&sslrootcert=/path/to/cert
DEBUG ce[][c.z.h.HikariConfig] keepaliveTime...................0
DEBUG ce[][c.z.h.HikariConfig] leakDetectionThreshold..........179000
DEBUG ce[][c.z.h.HikariConfig] maxLifetime.....................180000
DEBUG ce[][c.z.h.HikariConfig] maximumPoolSize.................200
DEBUG ce[][c.z.h.HikariConfig] metricRegistry..................none
DEBUG ce[][c.z.h.HikariConfig] metricsTrackerFactory...........none
DEBUG ce[][c.z.h.HikariConfig] minimumIdle.....................10
It seems that it is caused by some analysis, but it is pretty difficult for us to find out which kind because there are a lot of them.
We sometime see theses errors in the logs:
DEBUG ce[fd089a0c-fa5a-41dd-9a0a-e6c43c811e96][c.z.h.p.ProxyConnection] HikariPool-1 - Executed rollback on connection org.postgresql.jdbc.PgConnection@612f52f6 due to dirty commit state on close().
DEBUG ce[fd089a0c-fa5a-41dd-9a0a-e6c43c811e96][c.z.h.pool.PoolBase] HikariPool-1 - Reset (autoCommit) on connection org.postgresql.jdbc.PgConnection@612f52f
Is there anything we could do to solve this issue or track it down?
Kind regards,
/Lenain