Programming language you’re coding in: Java and Kotlin
Is connected mode used:
Connected to SonarCloud or SonarQube (and which version): SonarQube Developer Edition Version 9.6.1 (build 59531)
And a thorough description of the problem / question:
For myself and all of my team members, the “Checking SonarLint Binding Updates” background task is now running almost continuously (for 10s of minutes at a time at least). Occasionally when I look it’s not running, but before long it’s back.
I can browse the web interface for the bound SonarQube instance from the same system as my IDE no problem. It’s fast and reliable.
I’m not getting any error or timeout pop-ups, nor anything related in the Notifications tool window. I searched idea.log for “sonar”, but don’t see anything that appears relevant.
Thanks for raising this here. The ticket you mentioned was supposed to fix this issue, but there is probably another cause. Could you please capture a thread dump at the time you face this problem and share it with us ?
Sorry for the late update. Thanks for the thread dumps, it is useful, and I confirm that it’s not related to the ticket you linked in your first post and that we fixed for the latest release.
As you can see in the thread dump you both provided, SonarLint relies on git4idea, the internal Git integration plugin from JetBrains. It is used to identify the merge base between 2 commits or branches, which is helpful for us to match the current local Git branch with the server one.
It seems this command is taking a long time, which can be caused by 2 factors:
there are a lot of branches for this project on your SonarQube server.
the command itself is taking a long time, which could be caused by (random guesses at this point):
a big distance between your current HEAD and the server branch ?
a big Git repo ?
an old Git version ?
I will take some more time to investigate, in the meantime feel free to give more details about your configuration regarding the previous possible causes. If you are able to provide a reproducer with a simple project, that would also greatly help us!
I upgraded to SonarLint 8.0.0.63273 and SonarQube 9.9.0.65466. No change.
My git repo currently has 190 branches, but we don’t have branch or PR scanning setup, so the only branch being scanned is master. I currently have 9 branches checked out locally. All are close to master. I’m almost always fetch --alled and working at HEAD.
My local .git directory is 2.5GB. Code size according to SonarQube is 1.3M lines.
My local Git version is 2.37.1.windows.1.
The project in question is closed source, and the server is not on a public network, so I’m not sure how I could provide a reproducer. I’d be happy to perform requested troubleshooting or provide whatever further information I could otherwise.
After the SonarQube 9.9 upgrade I was expecting to see the Security Hotspots tab populated, but it still said I was not connected to a SonarQube 9.7+ server. I tried “Settings > Tools > SonarLint > Project Settings > Update local storage”. While it did complete, and I now see “No security hotspot found” on the tab, the corresponding background task took around 1/2 hour, so that’s another apparent long-running background task. I’m not sure whether it could be related to the long-running binding updates task at all.
A minor thing, but perhaps the tab should read “No security hotspots found” when in that state.
Could you try to install this version ? I added more logs around the branch resolution, could you open the logs tab in the SonarLint tool window and check if SonarLint is stucked on a specific log ?
I installed the linked version, 8.2.0.65545. Here’s all that’s in the logs tab after starting up and running for a few hours this morning (names were changed to protect the innocent):
Using connection 'My SonarQube Server' for project 'MyProject'
Analysing 'SomeTest.kt'...
Using connection 'My SonarQube Server' for project 'MyProject'
Analysing 4 files...
Using connection 'My SonarQube Server' for project 'MyProject'
Analysing 'SomeIT.kt'...
Using connection 'My SonarQube Server' for project 'MyProject'
Analysing 'build.gradle.kts'...
Using connection 'My SonarQube Server' for project 'MyProject'
Analysing 'SomeApp.java'...
Using connection 'My SonarQube Server' for project 'MyProject'
Analysing 'build.gradle.kts'...
Found 13 issues and 0 hotspots
Using connection 'My SonarQube Server' for project 'MyProject'
Analysing 'SomeTest.kt'...
Using connection 'My SonarQube Server' for project 'MyProject'
Analysing 4 files...
Using connection 'My SonarQube Server' for project 'MyProject'
Analysing 'SomeIT.kt'...
Using connection 'My SonarQube Server' for project 'MyProject'
Analysing 'build.gradle.kts'...
Using connection 'My SonarQube Server' for project 'MyProject'
Analysing 'SomeApp.java'...
Using connection 'My SonarQube Server' for project 'MyProject'
Analysing 'build.gradle.kts'...
Found 13 issues and 0 hotspots
It’s currently checking binding updates as of this capture.
Those entries seem to be logged each time I open a file for edit, so in other words, I don’t see any entries that appear to coincide with the start or eventual finish of the “Checking SonarLint Binding Updates” background task.