Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java language server fails to load, jdt process is hung #2047

Closed
jherico opened this issue Jul 30, 2021 · 1 comment
Closed

Java language server fails to load, jdt process is hung #2047

jherico opened this issue Jul 30, 2021 · 1 comment

Comments

@jherico
Copy link

jherico commented Jul 30, 2021

This is superficially like #158 but I believe this is actually a new issue caused by a very recent change.

That bug has a recent comment linking to this comment on #2020 which in turn links to this very recently fixed bug in Eclipse JDT-APT. The fix appears to have wrecked my ability to load my maven based projects.

Specifically, when I load a Maven project, eventually all CPU usage in the Java child processes ceases and when I run jstack against the JDT Java process I see this frame

"Worker-1: Initialize Workspace" #30 prio=5 os_prio=0 cpu=2996.36ms elapsed=39.67s tid=0x00007ff6bc001800 nid=0x5362 in Object.wait()  [0x00007ff71596c000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
        at java.lang.Object.wait([email protected]/Native Method)
        - waiting on <no object reference available>
        at org.eclipse.core.internal.jobs.JobManager.join(JobManager.java:1020)
        - waiting to re-lock in wait() <0x0000000082f00000> (a java.util.Collections$SynchronizedSet)
        at org.eclipse.jdt.apt.core.internal.generatedfile.GeneratedSourceFolderManager.removeFolder(GeneratedSourceFolderManager.java:508)
        at org.eclipse.jdt.apt.core.internal.generatedfile.GeneratedSourceFolderManager.folderNamePreferenceChanged(GeneratedSourceFolderManager.java:321)
        at org.eclipse.jdt.apt.core.internal.AptProject.preferenceChanged(AptProject.java:81)
        at org.eclipse.jdt.apt.core.util.AptConfig.setString(AptConfig.java:969)
        at org.eclipse.jdt.apt.core.util.AptConfig.setGenSrcDir(AptConfig.java:917)

The GeneratedSourceFolderManager.removeFolder() function at line 508 in the 0.80.0 version of this plugin is the newly introduced code by the the fix commit here. It looks as if the code is suffering from some kind of race condition and waiting on something that never occurs, causing the language server to eventually timeout.

As soon as I rolled back to 0.79.2 I'm able to load the project.

Environment
  • Operating System: Ubuntu 20.04.2 LTS
  • JDK version: OpenJDK Runtime Environment (build 11.0.11+9-Ubuntu-0ubuntu2.20.04)
  • Visual Studio Code version: 1.58.2
  • Java extension version: 0.80.0
Steps To Reproduce
  1. Open a maven multi-module project

I can't attach an actual project since it's not open source, but I can attach the pom files.

parent pom
common module pom
plans module pom

Current Result

Java projects window never populates.

Expected Result

Java projects window populates with all the modules

Additional Information
@snjeza
Copy link
Contributor

snjeza commented Jul 30, 2021

@jherico could you check #2020 (comment)

@jherico jherico closed this as completed Jul 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants