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] 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).