SonarQube
  1. SonarQube
  2. SONAR-2190

Database Locks when two projects are built simultaneously

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.5
    • Fix Version/s: 2.14
    • Component/s: Database, DB Cleaner
    • Labels:
      None
    • Environment:
      Sonar triggered from Hudson builds, running on Linux server

      Description

      Since version 2.5 of Sonar, in our Hudson/Sonar continuous integration build environment the following problem occurs:

      When two or more builds are created simultaneously and also the Sonar parts of the builds are running in parallel, then these builds regularly lock each other.

      For example, if we have a large project being built, which takes a long time, before all the Sonar checks are finished, and we then start the build of a small project, then this build will block in the PurgeDependencies step of the Sonar run, until it gets a timeout or the large build is killed.

      See the attached log excerpts for details. A heap dump was triggered for the large project build to be able to see, which threads are locked.

      1. large_project_log.txt
        17 kB
        Christian Loroff
      2. small_project_log.txt
        10 kB
        Christian Loroff

        Issue Links

          Activity

          Hide
          Andrea Aime added a comment -

          Btw, switching to PostgreSQL seems to have solved the issue. The sonar:sonar maven build appears to be significantly faster, too

          Show
          Andrea Aime added a comment - Btw, switching to PostgreSQL seems to have solved the issue. The sonar:sonar maven build appears to be significantly faster, too
          Hide
          Benjamin Schmid added a comment -

          We use sonar in around 24 Projects with sizes up to 250.000 Lines of Code (LOC).

          Though we increased the timeout up to 10 minutes, we experience increasing problem with this issue. Any progress and advices regarding this problem?

          @Andrea: How large is your installation just as a possible last resort if no cure is in sight?

          Show
          Benjamin Schmid added a comment - We use sonar in around 24 Projects with sizes up to 250.000 Lines of Code (LOC). Though we increased the timeout up to 10 minutes , we experience increasing problem with this issue. Any progress and advices regarding this problem? @Andrea: How large is your installation just as a possible last resort if no cure is in sight?
          Hide
          Michael Rumpf added a comment -

          This seems to be related to SONAR-1945.

          Show
          Michael Rumpf added a comment - This seems to be related to SONAR-1945 .
          Hide
          Andreas Mandel added a comment -

          Sorry to repeat myself. Can't the following be a solution for the issue:

          1. Set a smaller timeout for the purge operation, or better check for existing locks in advance if possible
          2. Do not let the build fail if one of the purge operations fails, just skip them silently
          Show
          Andreas Mandel added a comment - Sorry to repeat myself. Can't the following be a solution for the issue: Set a smaller timeout for the purge operation, or better check for existing locks in advance if possible Do not let the build fail if one of the purge operations fails, just skip them silently
          Hide
          Freddy Mallet added a comment -

          You're right Andreas, at least not failing the Sonar analysis could be a useful workaround while waiting for the purge mechanism refactoring.

          Show
          Freddy Mallet added a comment - You're right Andreas, at least not failing the Sonar analysis could be a useful workaround while waiting for the purge mechanism refactoring.

            People

            • Assignee:
              Simon Brandhof
              Reporter:
              Christian Loroff
            • Votes:
              10 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: