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

Sonar analysis is affected by connection timeout

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.11
    • Fix Version/s: 3.5
    • Component/s: Database, Scanner
    • Labels:
      None
    • Environment:
      MySQL

      Description

      Our Sonar instance is coupled with a MySQL DB. When JUnit tests take too much time (in our case more than 6 minutes) the MySQL connection seems to be closed. then Sonar analysis fails with:

      ...
      [INFO] [cobertura:cobertura {execution: default-cli}]
      [INFO] Cobertura 1.9.4.1 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file
      Cobertura: Loaded information on 51 classes.
      Report time: 6623ms
      
      [INFO] Cobertura Report generation was successful.
      [INFO]  Execute org.codehaus.mojo:cobertura-maven-plugin:2.5:cobertura done: 403111 ms
      [INFO]  Execute maven plugin cobertura-maven-plugin done: 403111 ms
      [INFO]  Initializer CoberturaMavenInitializer...
      [INFO]  Initializer CoberturaMavenInitializer done: 2 ms
      [INFO]  Sensor JavaSourceImporter...
      [WARN]  SQL Error: 0, SQLState: 08S01
      [ERROR]  Communications link failure
      
      The last packet successfully received from the server was 403 647 milliseconds ago.  The last packet sent successfully to the server was 12 milliseconds ago.
      [ERROR]  Could not toggle autocommit
      com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
      
      The last packet successfully received from the server was 403 652 milliseconds ago.  The last packet sent successfully to the server was 17 milliseconds ago.
      ...
      

      Maybe we could solve the problem by removing the timeout (we are investigating). But I feel Sonar could be improved by not keeping an open connection during long operations like JUnit/cobertura/cpd.

      This issue is in favor of a 2 stage analysis (see SONAR-2119).

        Attachments

          Activity

            People

            Assignee:
            henryju OLD - Julien HENRY
            Reporter:
            henryju OLD - Julien HENRY
            Votes:
            3 Vote for this issue
            Watchers:
            7 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: