Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SonarQube does not support parallel execution - How to use in continuous pipeline

Tags:

sonarqube

SonarQube does not support parallel execution as parallel execution is failing with:

Caused by: org.sonar.api.utils.SonarException: The project is already been analysing

I am using SonarQube v4.3.3 for code inspection.

Now my hudson jobs are running in parallel and due to this restriction I am not able to add sonar analysis to my Hudson job.

Please suggest how can I use SonarQube with hudson in a continuous pipeline using SonarQube.

like image 447
ChandraShekhar Vaishnav Avatar asked Sep 05 '25 06:09

ChandraShekhar Vaishnav


1 Answers

SonarQube 4.x does support parallel analysis of different projects, but not parallel analysis of the same project. This is a technical constraint to avoid conflicts when persisting analysis into the shared database.

SonarQube 5.2 introduces a major architecture change. Analyzers (launched by your Hudson job) are no more connected to database. They generate and send to server a report that contains only raw data, basically sources and issues. Computation of measures, validation of Quality gate and persistence are done asynchronously on server. In your case that allows analyzers to be executed in parallel, even on the same project, but they can't directly verify Quality gate. For that you should implement a kind of listener on web services to get the gate status when report is processed. See http://docs.sonarqube.org/display/SONAR/Breaking+the+CI+Build for more details. Note also that version 2 of the build breaker plugin implements this solution directly in the analyzer (see https://github.com/SonarQubeCommunity/sonar-build-breaker)

like image 195
Simon Brandhof - SonarSource Avatar answered Sep 07 '25 22:09

Simon Brandhof - SonarSource