eclipse-m2e / m2e-core

Eclipse Public License 2.0
114 stars 117 forks source link

Content-Assist in POM-Editor stuck in computing proposals #909

Open HannesWell opened 2 years ago

HannesWell commented 2 years ago

Activating the Content Assist in a Plugin's configuration section in the POM-Editor is occasionally stuck (subjectively forever):

grafik

I created two Thread Dumps (via VisualVM -> Threads ->Thread Dump, which is similar to what jstack does) a few minutes apart: ThreadDump1.txt ThreadDump2.txt

mickaelistria commented 2 years ago

Thanks. Is this something you can deterministically reproduce? Or at least frequently enough with some particular steps to reproduce? Note that the open Maven projects in your workspace does affect LemMinX resolution, so the overall workspace has an influence too.

HannesWell commented 2 years ago

Is this something you can deterministically reproduce?

At least at the moment even after a restart I can reproduce this in my M2E workspace, when I hit Ctrl+Space in the configuration of the modello-maven-plugin in the root pom.xml of M2E as displayed above.

It is provisioned by the M2E Oomph setup and contains respectively all M2E projects plus org.eclipse.simrel.build. The OS is Windows 10, Eclipse Version: 2022-09 RC1 (4.25.0 RC1), Build id: 20220901-1251 and M2E - POM Editor using LemMinX language server 2.0.0.20220729-1256. But I also encountered similar behavior in earlier versions.

But when looking at the thread dumps there are multiple threads - waiting to lock <0x00000006018004d0> (a org.apache.maven.project.DefaultProjectBuildingHelper), which is hold by a thread that basically spends all his time here:

at org.eclipse.lemminx.extensions.maven.MavenLemminxWorkspaceReader.lambda$findArtifact$4(MavenLemminxWorkspaceReader.java:179)

Looking at https://github.com/eclipse/lemminx-maven/blob/200ea92566f1427ca86b3f0657f0b6eaa385710c/lemminx-maven/src/main/java/org/eclipse/lemminx/extensions/maven/MavenLemminxWorkspaceReader.java#L179

I suspect that getCurrentWorkspaceArtifact() always returns an empty optional because whatever is intended to update the workspaceArtifacts is not doing it.

HannesWell commented 2 years ago

Duplicate of #768