Hi,
I am using SonarQube version 9.2.3. I am currently integrating our projects one by one into SonarQube analysis. Some of the projects are using Azure DevOps with the pipeline SonarQube plugin, others use different Build Systems.
Now I ran into massive performance issues with at least 2 different projects from our Azure projects (others seem to run OK, or at least not causing this huge issues). Both are .NET Projects.
Project 1:
Before SonarQube integration:
Complete build time: 6m44s
Build time of Build step “API Build”: 27s
Result: Always success
After SonarQube integration:
Complete build time (after increasing default 60m timeout): 1h14m (BUT: Build could not complete!)
Build time of Build step “API Build”: 1h10m (not finished, crashed during this step)
Result: Microsoft hosted build agent seems to crash (likely memory exhausted). Error:
,##[error]We stopped hearing from agent Hosted Agent. Verify the agent machine is running and has a healthy network connection. Anything that terminates an agent process, starves it for CPU, or blocks its network access can cause this error. For more information, see: https://go.microsoft.com/fwlink/?linkid=846610
Even though the message talks about CPU and network, some googling shows that mostly memory exhaustion seems to cause this.
The build step in question is just a simple:
- task: DotNetCoreCLI@2
displayName: Build Api
inputs:
command: 'build'
projects: 'xxxApi.csproj'
arguments: '--output $(Build.ArtifactStagingDirectory) --configuration Release'
Project 2:
Before SonarQube integration:
Total Build time: 12-13 minutes
Build step “Build Debug Implementation Client”: 2m12s
Build step “Build Debug Implementation Server”:2m8s
After SonarQube integration:
Complete Build time: 1h28m (had to increase default 60m timeout)
Build step “Build Debug Implementation Client”: 27m58s
Build step “Build Debug Implementation Server”:23m46s
The build steps in question here are simple VSBuild commands.
Those build times are unacceptable for a “per commit and branch” CI/CD pipeline, even though, in Project 2 at least I can finish the analysis… For Project 1 i have no idea how to fix it. I have no control over the microsoft hosted agents and normally they should work fine for such cases. It works in other projects.
How can I figure out what the issue is here? The log shows nothing suspicous…