Skip to content

Deadlock with Spring LSP in Eclipse 4.23 with STS 4.23 nighlies #729

Closed

Description

@gayanper

When running a large workspace with many spring project for a while, specially if the machine was resumed after sleep, working Java classes cause the deadlock. The java class operation which cause this deadlock is trying to ctrl + hover over a typename to get the hyperlink list. With this versions the Java element hyperlink list is also slow because the language server takes time to respond for hyperlink commands.

Versions:
Version: 2022-03 (4.23)
Build id: I20220131-0800

STS Versions:
Spring Boot Language Server Feature 4.13.1.202201310830 org.springframework.tooling.boot.ls.feature.feature.group VMware, Inc.
Spring IDE Boot Microservices Dash 4.13.1.202201311003 org.springframework.ide.eclipse.boot.dash.feature.feature.group Spring IDE Developers
Spring Tool Suite 4 Main Feature 4.13.1.202201311003 org.springframework.boot.ide.main.feature.feature.group VMware, Inc.
Spring XML Namespace Support 4.13.1.202201311003 org.springframework.ide.eclipse.xml.namespaces.feature.feature.group VMware, Inc.

Found one Java-level deadlock:
=============================
"ForkJoinPool.commonPool-worker-3":
  waiting to lock monitor 0x000001debd592760 (object 0x000000009ab00238, a com.google.common.base.Suppliers$NonSerializableMemoizingSupplier),
  which is held by "pool-3-thread-1"

"pool-3-thread-1":
  waiting to lock monitor 0x000001deabb9b060 (object 0x000000009ab002c0, a org.springframework.ide.eclipse.boot.dash.BootDashActivator),
  which is held by "ForkJoinPool.commonPool-worker-3"

Java stack information for the threads listed above:
===================================================
"ForkJoinPool.commonPool-worker-3":
        at com.google.common.base.Suppliers$NonSerializableMemoizingSupplier.get(Suppliers.java:166)
        - waiting to lock <0x000000009ab00238> (a com.google.common.base.Suppliers$NonSerializableMemoizingSupplier)
        at org.springframework.ide.eclipse.boot.dash.BootDashActivator.getModel(BootDashActivator.java:140)
        - locked <0x000000009ab002c0> (a org.springframework.ide.eclipse.boot.dash.BootDashActivator)
        at org.springframework.ide.eclipse.boot.dash.cf.BootDashTargetInfoSynchronizer.model(BootDashTargetInfoSynchronizer.java:96)
        at org.springframework.ide.eclipse.boot.dash.cf.BootDashTargetInfoSynchronizer.start(BootDashTargetInfoSynchronizer.java:47)
        at org.springframework.ide.eclipse.boot.dash.cf.BootDashCfPlugin.lambda$0(BootDashCfPlugin.java:25)
        at org.springframework.ide.eclipse.boot.dash.cf.BootDashCfPlugin$$Lambda$1429/0x0000000801fde4e0.run(Unknown Source)
        at java.util.concurrent.CompletableFuture$AsyncRun.run([email protected]/CompletableFuture.java:1800)
        at java.util.concurrent.CompletableFuture$AsyncRun.exec([email protected]/CompletableFuture.java:1792)
        at java.util.concurrent.ForkJoinTask.doExec([email protected]/ForkJoinTask.java:295)
        at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec([email protected]/ForkJoinPool.java:1016)
        at java.util.concurrent.ForkJoinPool.scan([email protected]/ForkJoinPool.java:1665)
        at java.util.concurrent.ForkJoinPool.runWorker([email protected]/ForkJoinPool.java:1598)
        at java.util.concurrent.ForkJoinWorkerThread.run([email protected]/ForkJoinWorkerThread.java:183)
"pool-3-thread-1":
        at org.eclipse.ui.plugin.AbstractUIPlugin.getPreferenceStore(AbstractUIPlugin.java:250)
        - waiting to lock <0x000000009ab002c0> (a org.springframework.ide.eclipse.boot.dash.BootDashActivator)
        at org.springframework.ide.eclipse.boot.dash.model.DefaultBootDashModelContext.<init>(DefaultBootDashModelContext.java:51)
        at org.springframework.ide.eclipse.boot.dash.model.DefaultBootDashModelContext.create(DefaultBootDashModelContext.java:67)
        at org.springframework.ide.eclipse.boot.dash.BootDashActivator.lambda$0(BootDashActivator.java:136)
        at org.springframework.ide.eclipse.boot.dash.BootDashActivator$$Lambda$1418/0x0000000801fd1758.get(Unknown Source)
        at com.google.common.base.Suppliers$NonSerializableMemoizingSupplier.get(Suppliers.java:167)
        - locked <0x000000009ab00238> (a com.google.common.base.Suppliers$NonSerializableMemoizingSupplier)
        at org.springframework.ide.eclipse.boot.dash.BootDashActivator.getInjections(BootDashActivator.java:149)
        at org.springframework.ide.eclipse.boot.dash.remoteapps.RemoteAppsFromBootDash.getRemoteApps(RemoteAppsFromBootDash.java:25)
        at org.springsource.ide.eclipse.commons.boot.ls.remoteapps.RemoteBootAppsDataHolder.union(RemoteBootAppsDataHolder.java:244)
        at org.springsource.ide.eclipse.commons.boot.ls.remoteapps.RemoteBootAppsDataHolder.<init>(RemoteBootAppsDataHolder.java:235)
        at org.springsource.ide.eclipse.commons.boot.ls.remoteapps.RemoteBootAppsDataHolder.getDefault(RemoteBootAppsDataHolder.java:53)
        - locked <0x000000009ab00d80> (a java.lang.Class for org.springsource.ide.eclipse.commons.boot.ls.remoteapps.RemoteBootAppsDataHolder)
        at org.springframework.tooling.boot.ls.DelegatingStreamConnectionProvider.getAllRemoteApps(DelegatingStreamConnectionProvider.java:239)
        at org.springframework.tooling.boot.ls.DelegatingStreamConnectionProvider.sendConfiguration(DelegatingStreamConnectionProvider.java:192)
        at org.springframework.tooling.boot.ls.DelegatingStreamConnectionProvider.handleMessage(DelegatingStreamConnectionProvider.java:129)
        at org.eclipse.lsp4e.LanguageServerWrapper.lambda$4(LanguageServerWrapper.java:265)
        at org.eclipse.lsp4e.LanguageServerWrapper$$Lambda$1168/0x0000000801da8920.consume(Unknown Source)
        at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:194)
        at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:94)
        at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:113)
        at java.util.concurrent.Executors$RunnableAdapter.call([email protected]/Executors.java:515)
        at java.util.concurrent.FutureTask.run([email protected]/FutureTask.java:264)
        at java.util.concurrent.ThreadPoolExecutor.runWorker([email protected]/ThreadPoolExecutor.java:1130)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run([email protected]/ThreadPoolExecutor.java:630)
        at java.lang.Thread.run([email protected]/Thread.java:831)

Activity

  1. added this to the 4.14.0.RELEASE milestone on Feb 9, 2022
  2. self-assigned this
    on Feb 9, 2022
  3. BoykoAlex commented on Feb 9, 2022

    @BoykoAlex
    Contributor

    AbstractUIPlugin#getPreferenceStore() became sychronized on the plugin instance in 4.23 which makes DefaultBootDashModelContext constructors synced on the BootDashActivator.
    I suspect if we make BootDashActivator#getInjections() synchronized it'd solve the issue.

  4. BoykoAlex commented on Feb 9, 2022

    @BoykoAlex
    Contributor

    Fixed with d3d0287

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions