Bug 552518 - UI freeze in HyperlinkDetectorDelegate.detectHyperlinks
Summary: UI freeze in HyperlinkDetectorDelegate.detectHyperlinks
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.14   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-10-29 08:43 EDT by Lars Vogel CLA
Modified: 2019-11-02 07:32 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Vogel CLA 2019-10-29 08:43:06 EDT
After installing Wild Web Developer into my IDE, I see lots of small UI freezes reported. See below for the stack trace.

Not sure if that is an issue in lsp4e or in platform.

Stack Trace
	at java.base@12.0.1/jdk.internal.misc.Unsafe.park(Native Method)
	at java.base@12.0.1/java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:235)
	at java.base@12.0.1/java.util.concurrent.CompletableFuture$Signaller.block(CompletableFuture.java:1869)
	at java.base@12.0.1/java.util.concurrent.ForkJoinPool.managedBlock(ForkJoinPool.java:3128)
	at java.base@12.0.1/java.util.concurrent.CompletableFuture.timedGet(CompletableFuture.java:1939)
	at java.base@12.0.1/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2092)
	at org.eclipse.lsp4e.operations.declaration.OpenDeclarationHyperlinkDetector.detectHyperlinks(OpenDeclarationHyperlinkDetector.java:90)
	at org.eclipse.ui.texteditor.HyperlinkDetectorRegistry$HyperlinkDetectorDelegate.detectHyperlinks(HyperlinkDetectorRegistry.java:81)
	at org.eclipse.jface.text.hyperlink.HyperlinkManager.findHyperlinks(HyperlinkManager.java:289)
	at org.eclipse.jface.text.hyperlink.HyperlinkManager.findHyperlinks(HyperlinkManager.java:262)
	at org.eclipse.jface.text.hyperlink.HyperlinkManager.mouseMove(HyperlinkManager.java:457)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:216)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:5667)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1423)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4926)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4420)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1160)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1049)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
	at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:660)
	at org.eclipse.ui.internal.Workbench$$Lambda$187/0x00000008013b0840.run(Unknown Source)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:559)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:150)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
	at java.base@12.0.1/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base@12.0.1/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base@12.0.1/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base@12.0.1/java.lang.reflect.Method.invoke(Method.java:567)
	at app//org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:657)
	at app//org.eclipse.equinox.launcher.Main.basicRun(Main.java:594)
	at app//org.eclipse.equinox.launcher.Main.run(Main.java:1465)
	at app//org.eclipse.equinox.launcher.Main.main(Main.java:1438)
Comment 1 Michael Keppler CLA 2019-11-02 07:32:04 EDT
Looking at the code in https://git.eclipse.org/c/lsp4e/lsp4e.git/tree/org.eclipse.lsp4e/src/org/eclipse/lsp4e/operations/declaration/OpenDeclarationHyperlinkDetector.java#n90 I assume that lsp4e waits up to 500 msecs for all the language servers to complete that operation. If your UI freeze reporting is set to a threshold lower than 500 msecs you probably see an issue for each invocation that reaches the 500 msecs limit.

However, I might be completely wrong with this analysis, since I have never used CompletableFutures yet.