Number of analysis tasks grows over time; they never complete

Please provide

  • Operating system: Linux - Debian12
  • CLion: 2024.1.3
  • SonarLint plugin version:
  • Programming language you’re coding in: C++
  • Is connected mode used: Yes
    • Connected to SonarCloud or SonarQube (and which version): Corporate SonarQube 9.9.6

And a thorough description of the problem / question:

SonarLint processes build up over time, do not complete. CPU resources continually being used.

Clone a fresh copy of my C++ project from GIT.
Open it in CLion.
Open a single source file.
SonarLint starts to analyse the file. The list of issues is updated but the analysis task never completes.
As I edit the file to fix the issues, a number of ‘Stopping - SonarLint analysis’ are created. The longer I edit, the more of these I get. They never complete (I left the PC alone for 30 mins and they were all still there when I came back to it). The issues list does not reduce as I edit the file to solve the issues.
If I open more files to edit, the number of running tasks is compounded, consuming more and more CPU.
I have tried with the local project connected to our corporate SonarQube server and with no connection. Same result.

Why does the analysis of a source file never complete?
Why do the ‘Stopping - SonarLint analysis’ tasks never complete?
How can I recover the Linter so that it works properly and stops thrashing my PC?

Hello @jump-jet, thank you for reaching out to us regarding this issue. This is definitely not acceptable, and we would really appreciate your support on this.

When the analysis is stuck, could you please provide us with logs and thread dumps:

  • one dump from Intellij
  • one dump for the backend of SonarLint service; That can be done by eg. running jps command from console to find id of the JVM process for SonarLintServerCli and then making a dump with jstack jstack <id>

Do you also use CLion with any specific configuration, such as WSL for example?

Thanks for the reply.

Well eventually it sorted itself out. I came back to the PC after over an hour and all of the analysis tasks had completed. It has been fairly well behaved ever since.

At its peak, I had between six and eight source files open in the IDE and I observed more than 60 background tasks. There was an Analysis task for each file, an Analysing task for each file and the rest were all Stopping Analysis tasks (which cannot be cancelled).

It has been behaving itself today with some different files open. I propose to monitor the situation and take further action only if it becomes problematic again.

Thanks, @jump-jet, for the heads-up. I identified a scenario where this behavior can happen, and I will try to fix it for our next release at the end of the month.