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

changing issue/hotspot status can be super slow on H2

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None
    • Edition:
      Community
    • Production Notes:
      None

      Description

      Reproducer

      • start brand new SQ running on H2
      • analyse a project with ~500 issues (less could be enough to trigger the problem but won't be as visible): eg. phpBB
      • go to issue page or hotspot page and try and change status
      • call to api/issues/do_transition and api/hotspots/change_status can take up to 1 minute

      The slowness can not be reproduced on PostgreSQL and we assume it doesn't affect Oracle nor SQLServer as users would have complained.

      Analyse PhpBB

      clone https://github.com/phpbb/phpbb.git

      run following command

      export SONAR_SCANNER_OPTS="-Xmx4096m"
      sonar-scanner -Dsonar.host.url=http://localhost:9000 \
         -Dsonar.projectKey=phpBB \
         -Dsonar.projectName=phpBB \
         -Dsonar.sources=. \
         -Dsonar.scm.disabled=true \
         -Dsonar.cpd.exclusions=** \
         -Dsonar.branch.autoconfig.disabled=true \
         -Dsonar.exclusions=**/tests/**/*,**/test/**/*,**/fonts/**/*,vendor/**/*,**/*.js,**/*.css,**/*.sql,**/*.frm \
         -Dsonar.c.file.suffixes=- \
         -Dsonar.cpp.file.suffixes=- \
         -Dsonar.objc.file.suffixes=-
      

      WHAT

      Quick investigation lead to identifying that the slowness of the WS call came from a SQL query which can be as many times as the project has components:

       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                sebastien.lesaint Sebastien Lesaint
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: