Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-11539

Properties sonar.jdbc.maxActive and sonar.jdbc.maxWait are unexpectedly ignored and have incorrect default values

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 7.4
    • Fix Version/s: 7.5
    • Component/s: Database
    • Labels:
      None
    • Edition:
      Community
    • Production Notes:
      None

      Description

      What

      The properties sonar.jdbc.maxActive and sonar.jdbc.maxWait are documented in sonar.properties but are unexpectedly ignored in version 7.4. The default value of sonar.jdbc.maxActive also dropped from 60 to 8. That aims to a significant decrease of the capability to sustain the HTTP load.

      The bug was introduced when moving the db connection pool to commons-dbcp. Any property names "sonar.jdbc.*" is passed to the DB pool implementation (after removing "sonar.jdbc.") to tune its configuration.

      In sonar.properties, we document the following properties:
      sonar.jdbc.maxActive=60
      sonar.jdbc.maxIdle=5
      sonar.jdbc.minIdle=2
      sonar.jdbc.maxWait=5000
      sonar.jdbc.minEvictableIdleTimeMillis=600000
      sonar.jdbc.timeBetweenEvictionRunsMillis=30000

      Unfortunately, with commons-dbcp:

      • maxActive is named maxTotal, and default is 8
      • maxWait is named maxWaitMillis

      Workaround

      Temporarily set the properties with the commons-dbcp names:
      sonar.jdbc.maxTotal=60
      sonar.jdbc.maxWaitMillis=5000

      Solution

      Remove the coupling between user properties ("sonar.jdbc.*) and the pool implementation (commons-dbcp for the time being, may be replaced by HikariCP). Only the properties sonar.jdbc.maxActive and sonar.jdbc.maxWait should be supported.

      An integration test should be added to prevent new regressions. A simple test is to check the pool characteristics from the system info web api. It gets the effective values directly from the pool, not from the declared settings.

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            benoit.gianinetti Benoit Gianinetti
            Reporter:
            simon.brandhof Simon Brandhof
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Due:
              Created:
              Updated:
              Resolved: