SonarQube for Visual Studio plugin version: 8.14.0.12562
Programming language you’re coding in: C# and VB.NET
Is connected mode used: Yes
SonarQube Server v10.8.1
And a thorough description of the problem / question:
Sometimes Sonarqube for Visual Studio is consuming 100% CPU on all 16 cores, slowing down the entire system.
I cannot trace the trigger to a specific action like opening a certain file, it seems occurring randomly. When it occurs it last for some time, maybe indefinitely. I have to restart Visual Studio to fix the problem.
I can say that it comes from Sonarqube because I don’t have this problem when the extension is disabled.
In addition I captured profiling traces (which I can provide) that shows CPU time spent in libgit2sharp used by Sonarqube functions (for instance SonarQubeService.GetProjectBranchesAsync for 90% CPU time).
This occurs with a large solution and repository, here are a few details about it:
Thank you for reporting the performance issues you’re experiencing with SonarQube for Visual Studio.
We have investigated this issue and identified a threading problem within the code responsible for branch matching. It appears that the matching branch is being calculated multiple times concurrently from different threads. Given that your repository contains a significant number of branches (approximately 4000), this redundant computation can indeed lead to the high CPU utilization and performance degradation you are observing.
We have created a ticket on our backlog to address this issue: Jira.
We understand the impact this is having on your workflow and have prioritized this fix for our upcoming sprint. We will keep you updated on the progress through the ticket.
In the meantime, unfortunately, there isn’t a straightforward workaround we can suggest within the SonarQube for Visual Studio extension itself to directly mitigate this specific threading issue.
Thank you for your patience and understanding as we work to resolve this.