SonarLint hanging in IntelliJ

Please provide

  • Operating system: Mac Monterey v12.3.1
  • IDE name and flavor/env: IntelliJ Idea 2022.1 Build #IU-221.5080.210
  • SonarLint plugin version: 670.7.0.45926
  • Is connected mode used:
    • Connected to SonarQube (and which version): 9.4 (build 54424)

The SonarLint plugin will hang trying to get updates from our SonarQube instance running in AWS on an EC2 instance. Note that it isn’t just a connectivity issue due to misconfiguration. It works fine when the IDE first starts up. But, after a while, in the background, the plugin tries to reach out to SonarQube and it just hangs. Trying to cancel it hangs too. And over time, the IDE keeps starting up more requests, none of which can be cancelled. I end up having to shut the IDE down to stop them.

This was not happening before we updated to SonarQube 9.4 recently.

I don’t know if IntelliJ has any way for me to see logs for the plugin so I can maybe get a sense of where it is hanging.

Hi @Anthony_Collins

Thanks for reporting the issue.

Would you be able to capture a thread dump when SonarLint is stuck?
Since SonarQube 9.4, SonarLint will open a persistent connection to receive live events from SonarQube. We are aiming at progressively replacing our polling approach. Maybe this is causing unexpected side effects.

Hi Julien,

I’m attaching a thread dump generated using jstack -e. Not sure if that is what you need. Note that at the time of this generation, IntelliJ is showing 6 background tasks running all labeled “Checking SonarLint Binding Updates”. As far as I can tell, they will never terminate.

Hope this helps.

Tony

thread_dump.txt (6.5 KB)

Hello @Anthony_Collins,

I see nothing related to SonarLint in this thread dump, you probably captured the wrong Java process. Could you give it another try please ? This could be useful for us.

This “Checking SonarLint Binding Updates” can hang for a while if the server is temporarily unreachable, but it should timeout after a while, and having 6 of them means the problem occurs for the last 6 hours…

Hi Damien,

I thought the same as well. Note though that that was the only Java process running on my machine at the time. But this happens to me daily, so I should be able to check again soon.

Tony

Here is a screenshot from my currently running IntelliJ. Note that at present there is NO java process running on my system (at least not that shows up from running “ps -ef |grep -i java”).

You should try to use jps (see here for more details).

Usually the IntelliJ process is called ‘Main’.

I have attached a new thread dump. In this one, I see threads related to sonar lint. I see 24 lines that reference org.sonarlint.intellij.core.QualityProfileSynchronizer and they are grouped in twos. I am currently showing 12 background tasks run “Checking SonarLint Binding Updates”. Guessing that is not a coincidence.
tdump1.txt (142.5 KB)

Hello Anthony,

Just to let you know that I just reproduced this on my local machine. I still need to figure out why this happens, and I don’t have much time to do the investigation right now, but I will keep you informed when I will know more.

Awesome. Thanks for letting me know, Damien!

Hey Damien,

I don’t know if you got a chance to fix this issue or maybe someone else did. I wanted to report that I installed the latest version of the SonarLint plugin yesterday (6.8.0.50884) and the issue seems to have gone away. So, if it was you or someone else who fixed the issue, just wanted to say thanks.

1 Like

Damien,

Please ignore my previous post. Looks like I spoke too soon. I am now seeing the issue again. Looks like it just took longer to show up after installing the new pluging.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

Windows 10 - Intellij 2022.2.1 - SonarLint 7.0.0.52289 - SonarQube 8.9.8 (build 54436)

This background task starts with intellij but never terminates. It also conflicts with the local antimalware solution, which jumps to a permanent >50% CPU, while the task is running.

There’s no message on the idea.log, that would give further hints. The only solution so far was disabling the plugin to make the system usable for development again.