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

An HTTP timeout exception might be thrown when launching a Sonar analysis on big project



    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.4, 3.4.1
    • Fix Version/s: 3.5
    • Component/s: Database, Scanner
    • Labels:
    • Environment:
      Any. I am not sure, but the number of affected versions might be more between 2.14 and 3.4.1


      I have upgraded my Sonar from version 2.14 to 3.4.1. The issue I am currently encountering is that Ant Runner (1.4 and 2.0 as well) task fails for Project that contains many packages (without any submodules).

      The error I get is:

      00:39:17]sonar (21s)
      [00:39:17][sonar] sonar:sonar (21s)
      [00:39:39][sonar:sonar] org.sonar.api.utils.SonarException: Unable to request: /batch_bootstrap/properties?project=com.abc.xyz.ops:main

      The problem is that the response to the link: http://sonar/batch_bootstrap/properties?project=com.abc.xyz.ops:main is extremely slow (over 1 minute) and the ant sonar runner is not waiting so long. It throws timeout exception after 20 seconds. With sonar 2.14 it was not the case and the link was not used at all.

      Once I turned on logging SQL into profile.log I see indeed, that there are thousands of single SQL-Select being run:
      SELECT * FROM properties WHERE (user_id is null and resource_id=<many-resource-ids>) and each of the resource-id seems to point to different sub-item (like package, class, unit-test) in the project.

      The above IDS are retrieved from the “top-query”: SELECT id,kee FROM projects WHERE (enabled=1 and (root_id=<some-id> or id=<some-other-id>) – it gives over 7000 rows (to be used to create next queries).

      Is it a defect or functionality? IMO Sonar should use single SELECT with subselect in order to get the results of this query instead of running the same query 7000 times for different items (identifiers) separately when it answers to the above link (“/batch_bootstrap”).

      I have tried also to set up the sonar parameters (sonar.host.connectTimeoutMs, sonar.host.readTimeoutMs) to change the timeout but it does not seem to be working (it is stated that these are maven-plugin parameters).

      Do you have any suggestions how to resolve the problem? It looks like myproject cannot get rid of ant (ant sonar runner) easily. (I do not have such issues with maven projects).



          Issue Links



              simon.brandhof Simon Brandhof (Inactive)
              btosabre BTO Team from Sabre Holdings
              0 Vote for this issue
              12 Start watching this issue