When workspace up and initialized - SonarQube can be installed/enabled without any problems.
But when IDE gets restarted (with already installed and enabled SonarQube) - 100% CPU utilization and permanent errors in logs:
2025-10-20 09:51:33.975 [info] [Debug - 09:51:33.973] Skipping analysis of file not open in the editor: "file:///c:/Workspaces/git/testproject/testbackend/src/main/java/org/example/service/TestService.java"
2025-10-20 09:51:34.134 [info] [Error - 09:51:34.132] Unable to get Java config.
java.util.concurrent.TimeoutException
at java.base/java.util.concurrent.CompletableFuture.timedGet(CompletableFuture.java:1960)
at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2095)
at org.sonarsource.sonarlint.ls.java.JavaConfigCache.getOrFetch(JavaConfigCache.java:64)
at org.sonarsource.sonarlint.ls.folders.ModuleEventsProcessor.lambda$isTestFile$3(ModuleEventsProcessor.java:128)
at org.sonarsource.sonarlint.ls.file.FileTypeClassifier.isTest(FileTypeClassifier.java:42)
at org.sonarsource.sonarlint.ls.folders.ModuleEventsProcessor.isTestFile(ModuleEventsProcessor.java:128)
at org.sonarsource.sonarlint.ls.folders.ModuleEventsProcessor.lambda$getClientFileDto$1(ModuleEventsProcessor.java:118)
at java.base/java.util.Optional.ifPresentOrElse(Optional.java:196)
at org.sonarsource.sonarlint.ls.folders.ModuleEventsProcessor.getClientFileDto(ModuleEventsProcessor.java:113)
at org.sonarsource.sonarlint.ls.folders.ModuleEventsProcessor.notifyBackendWithFileLanguageAndContent(ModuleEventsProcessor.java:95)
at org.sonarsource.sonarlint.ls.SonarLintLanguageServer.lambda$didOpen$6(SonarLintLanguageServer.java:454)
at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646)
at java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:483)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:387)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1312)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1843)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1808)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:188)
also these:
2025-10-20 09:51:33.879 [info] [Error - 09:51:33.867] Unable to get Java config.
java.util.concurrent.RejectedExecutionException: Thread limit exceeded replacing blocked worker
at java.base/java.util.concurrent.ForkJoinPool.tryCompensate(ForkJoinPool.java:2000)
at java.base/java.util.concurrent.ForkJoinPool.compensatedBlock(ForkJoinPool.java:3737)
at java.base/java.util.concurrent.ForkJoinPool.managedBlock(ForkJoinPool.java:3723)
at java.base/java.util.concurrent.CompletableFuture.timedGet(CompletableFuture.java:1939)
at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2095)
at org.sonarsource.sonarlint.ls.java.JavaConfigCache.getOrFetch(JavaConfigCache.java:64)
at org.sonarsource.sonarlint.ls.folders.ModuleEventsProcessor.lambda$isTestFile$3(ModuleEventsProcessor.java:128)
at org.sonarsource.sonarlint.ls.file.FileTypeClassifier.isTest(FileTypeClassifier.java:42)
at org.sonarsource.sonarlint.ls.folders.ModuleEventsProcessor.isTestFile(ModuleEventsProcessor.java:128)
at org.sonarsource.sonarlint.ls.folders.ModuleEventsProcessor.lambda$getClientFileDto$1(ModuleEventsProcessor.java:118)
at java.base/java.util.Optional.ifPresentOrElse(Optional.java:196)
at org.sonarsource.sonarlint.ls.folders.ModuleEventsProcessor.getClientFileDto(ModuleEventsProcessor.java:113)
at org.sonarsource.sonarlint.ls.folders.ModuleEventsProcessor.notifyBackendWithFileLanguageAndContent(ModuleEventsProcessor.java:95)
at org.sonarsource.sonarlint.ls.SonarLintLanguageServer.lambda$didOpen$6(SonarLintLanguageServer.java:454)
at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646)
at java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:483)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:387)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1312)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1843)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1808)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:188)
Tried different projects, different workspaces. Single-module, multiple-modules, multi-root workspaces. Same issue.
Is it possible somehow prioritize the Issue in bugtracker?
I split out your reply into a separate new post. Thanks for reporting the issue!
SonarQube for IDE requires Java extension to be available in the IDE, we rely on it to fetch necessary Java-related configurations in order to run accurate analysis. The errors from the stacktrace indicate that fetching Java config failed.
Could you please share the list of extensions you have installed? And make sure it includes redhat.java extension?
It might be that the Java extension was not properly activated for some reason. Did the issue start appearing recently?
As wrote earlier: Java extension works fine unless I activate SonarQube extension and restart IDE.
If I activate SonarQube on already running and initialized Windsurf - it also works just fine.
But problems start when I start IDE with previously activated SonarQube.
Same problem I had back in January, when was using another computer with another version of Windows and was using VSCode as IDE, and earlier version of SonarQube. Didn’t find proper solution back then, so was deactivating the extension most of the time.
This is very strange and for the moment I cannot reproduce (tried on a Gradle project with Java and SonarQube for IDE extensions installed, and the issues are detected).
Maybe when you start the IDE, if you have a Java file open right away, SonarQube tries to trigger analysis but the Java extension is not initialized yet at that point? Would you be able to share a screenshot of how long was taken by Java extension activation? (141ms in my screenshot) and the SonarQube for IDE activation? And finally, if you could also provide an example file that triggers the failures, it would be a great help!!
I reproduced an issue on a Windows machine (not consistently though). It happened while SonarQube analysis was started before Java project was loaded in the IDE BUT, importantly, even though I had the error logs in the output, once the project was loaded, the analysis results still appeared (see screenshot). Do you observe the same? Or are issues never coming up?
Start Windsurf, open Workspace with 2 Gradle-based Java modules. Wait till workspace is fully initialized. Close all editors.
Activate SonarQube extension. Extension is loaded within 268ms. CPU usage pikes for a minute. After a minute, project get analyzed, CPU drops downs to 0, analysis results is displayed on SonarQube tab. (see screenshot)
Exit Winsurf. Wait for couple minutes, to make sure no java.exe processes left running (checked in processes view).
Start Windsurf. Java extension gets initialized within 291ms, SonarQube within 489ms. But CPU usage raises to 100%, SonarQube logs gets filled with Timeout and Thread limit exceptions. No problem analysis results available. This state is now forever. The only option is available - deactivate extension and restart IDE.
Sorry for the delay. We have not forgotten about you
I’ve been trying to reproduce the issue but with no success. i.e. I have this - similar error as you with timeout, but once the Java extension is loaded, SonarQube for IDE also recovers and starts analyzing Java files.
I will try to install exactly the same set of extensions as you have and see if something changes.
I’ve updated my ‘vanilla’ VSCode (original, from Microsoft, not using for several months already, as migrated to Windsurf), and it seems they have tuned something. Now I’m not getting any exceptions on SonarQube initialization on startup of VSCode.
VSCode OSS Version is one minor version behind, but I didn’t find in changes anything significant. May be i’ve overseen it. Or it’s caused by some default parameters, which are not perfectly fine tuned in Windsurf.
When you migrated to Windsurf, did you use their automatic migration feature? i.e. one that directly moves your VSCode config to Windsurf? Or you started on Windsurf from scratch?
When you migrated to Windsurf, did you use their automatic migration feature? i.e. one that directly moves your VSCode config to Windsurf? Or you started on Windsurf from scratch?
I tried both: migration and clean install (first tried to delete profiles and recreate them from scratch, but then clean install).
Also, yesterday, when realized VSCode works now, I also synchronized my user settings.json, to make sure all JVM settings are same in both IDE’s. But seems nothing from custom settings affects on why VSCode is fine, but Windsurf fails. Either some defaults are different, or internal IDE params (or 105.1 fixes something).
As promised, I tried installing all the same extensions as you have, and finally managed to reproduce the issue!
Then I started disabling extensions one-by-one to find the culprit
Disabling vscjava.vscode-java-dependency & restarting the window seemed to make a difference Like for you, it also works for me on VS Code. What I notice is that on VS Code I have v0.26.4 of the extension, while on Windsurf it’s v0.26.3. Their change note for v0.26.4 contains something interesting:
Fix - unblocking activation of extension while registering copilot context provider #937
Could you also try on your side if disabling Project Manager for Java extension helps?
It’s true that open-vsx.org (used by Windsurf) has older version of the extension than microsoft marketplace.
But once I started my VSCode, I realized that Project Manager for Java extension was v0.26.2 yet, and I was promted to update to the latest 0.26.4. Means the SonarQube was working fine with v0.26.2 before, and keeps working with v0.26.4.
Anyhow, I’ve completely disabled the Project Manager for Java extension in Windsurf, but nothing has changed: after IDE restart, the SonarQube still falls same into unrecoverable state.
Probably there is some threshold of project size, after which problems begin. I tested with small project - it works fine with Windsurf restarts and active SonarQube.
On big projects - permanent problems. Switch between SonarQube focus: new code or overall code doesn’t make any difference.
One of the Java extensions is flooding the IDE with textDocument/didOpen events. This is an LSP notification that is meant for notifying Language Servers that a file was open in the IDE
When our (SonarQube for IDE) language server receives these didOpen events, it kicks off several processes
Fetching Java config & trying to determine if file is test file or not
Launching analysis
etc etc
In order to protect ourselves from such floods of didOpen events we already try to filter out the files that are not open in the editor, but in this case when I debugged with Windsurf, most of the files are considered as being open in the editor So the “protection” layer is not working
This is what hogs the CPU.
As a next step, I will try to pinpoint exactly which extension from the Java extension pack is causing this, and open an issue for them. It might again take some time though Sorry about that. We will also think about some alternative “protection mechanisms” to prevent such scenarios on our side.
Thanks for your patience & wish you all the best,
Sophio
As a quick-dirty workaround, can it be introduced some kind of "sonarlint.startupDelay:0” setting? So SonarQube can ignore all events during this period.
I will check what we can do. Because even if this specific extension stops flooding with didOpen events, we cannot guarantee some other extension does not do it another time.
Also additional detail why it might be working on VS Code is that we rely on the VSCode APIs to check if the file is open in editor or not, and it might be that the implementation of this method is different in Windsurf … ??