Skip to content

deadlock in language server process avoids process to be shutdown #741

Closed

Description

@martinlippert

Today I came across the situation that a number of Spring Boot Language Server process kept running on my machine, even though I shutdown VSCode. I tried to kill them all, but some of them refused to terminate. Running jstack on them revealed that the process is hanging in a deadlock and therefore isn't able to terminate in a regular way.

2022-03-01 12:31:38
Full thread dump Java HotSpot(TM) 64-Bit Server VM (11.0.10+8-LTS-162 mixed mode):

Threads class SMR info:
_java_thread_list=0x00006000029e9080, length=18, elements={
0x00007fe8e2022000, 0x00007fe8e2025000, 0x00007fe8b2008800, 0x00007fe8b200b800,
0x00007fe8e3a60000, 0x00007fe8e405b800, 0x00007fe8e3a80000, 0x00007fe8e1877000,
0x00007fe8e200b800, 0x00007fe8e4305800, 0x00007fe8e433a000, 0x00007fe8e3bda800,
0x00007fe8e3c92800, 0x00007fe8e3c7d000, 0x00007fe8e21d9800, 0x00007fe8e4300000,
0x00007fe8e2193000, 0x00007fe8e2173000
}

"Reference Handler" #2 daemon prio=10 os_prio=31 cpu=1.61ms elapsed=600369.96s tid=0x00007fe8e2022000 nid=0x4403 waiting on condition  [0x000070000be59000]
   java.lang.Thread.State: RUNNABLE
	at java.lang.ref.Reference.waitForReferencePendingList([email protected]/Native Method)
	at java.lang.ref.Reference.processPendingReferences([email protected]/Reference.java:241)
	at java.lang.ref.Reference$ReferenceHandler.run([email protected]/Reference.java:213)

"Finalizer" #3 daemon prio=8 os_prio=31 cpu=0.31ms elapsed=600369.96s tid=0x00007fe8e2025000 nid=0x3303 in Object.wait()  [0x000070000bf5c000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait([email protected]/Native Method)
	- waiting on <0x000000078006a4f0> (a java.lang.ref.ReferenceQueue$Lock)
	at java.lang.ref.ReferenceQueue.remove([email protected]/ReferenceQueue.java:155)
	- waiting to re-lock in wait() <0x000000078006a4f0> (a java.lang.ref.ReferenceQueue$Lock)
	at java.lang.ref.ReferenceQueue.remove([email protected]/ReferenceQueue.java:176)
	at java.lang.ref.Finalizer$FinalizerThread.run([email protected]/Finalizer.java:170)

"Signal Dispatcher" #4 daemon prio=9 os_prio=31 cpu=34.26ms elapsed=600369.95s tid=0x00007fe8b2008800 nid=0x3d03 runnable  [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C1 CompilerThread0" #5 daemon prio=9 os_prio=31 cpu=1509.91ms elapsed=600369.95s tid=0x00007fe8b200b800 nid=0x5503 waiting on condition  [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE
   No compile task

"Sweeper thread" #17 daemon prio=9 os_prio=31 cpu=1.03ms elapsed=600369.95s tid=0x00007fe8e3a60000 nid=0xa703 runnable  [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Service Thread" #18 daemon prio=9 os_prio=31 cpu=0.04ms elapsed=600369.91s tid=0x00007fe8e405b800 nid=0x5803 runnable  [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Common-Cleaner" #19 daemon prio=8 os_prio=31 cpu=123.52ms elapsed=600369.90s tid=0x00007fe8e3a80000 nid=0xa503 in Object.wait()  [0x000070000c674000]
   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 java.lang.ref.ReferenceQueue.remove([email protected]/ReferenceQueue.java:155)
	- waiting to re-lock in wait() <0x000000078006ba38> (a java.lang.ref.ReferenceQueue$Lock)
	at jdk.internal.ref.CleanerImpl.run([email protected]/CleanerImpl.java:148)
	at java.lang.Thread.run([email protected]/Thread.java:834)
	at jdk.internal.misc.InnocuousThread.run([email protected]/InnocuousThread.java:134)

"DestroyJavaVM" #25 prio=5 os_prio=31 cpu=1339.30ms elapsed=600368.34s tid=0x00007fe8e1877000 nid=0x1703 waiting on condition  [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Simple-Language-Server main thread" #27 daemon prio=5 os_prio=31 cpu=4111.94ms elapsed=600368.22s tid=0x00007fe8e200b800 nid=0x8d03 waiting for monitor entry  [0x000070000d7a6000]
   java.lang.Thread.State: BLOCKED (on object monitor)
	at org.springframework.ide.vscode.commons.languageserver.java.FutureProjectFinder.resolvePendingRequests(FutureProjectFinder.java:73)
	- waiting to lock <0x00000007bc3277c8> (a org.springframework.ide.vscode.commons.languageserver.java.FutureProjectFinder)
	at org.springframework.ide.vscode.commons.languageserver.java.FutureProjectFinder$1.created(FutureProjectFinder.java:39)
	at org.springframework.ide.vscode.boot.jdt.ls.JdtLsProjectCache.notifyCreated(JdtLsProjectCache.java:124)
	- locked <0x00000007bc338180> (a java.util.ArrayList)
	at org.springframework.ide.vscode.boot.jdt.ls.JdtLsProjectCache$JstLsClasspathListener.lambda$changed$0(JdtLsProjectCache.java:357)
	- locked <0x00000007bc327670> (a java.util.HashMap)
	at org.springframework.ide.vscode.boot.jdt.ls.JdtLsProjectCache$JstLsClasspathListener$$Lambda$454/0x0000000800435840.run(Unknown Source)
	at reactor.core.publisher.MonoRunnable.call(MonoRunnable.java:73)
	at reactor.core.publisher.MonoRunnable.call(MonoRunnable.java:32)
	at reactor.core.publisher.MonoCallableOnAssembly.call(MonoCallableOnAssembly.java:90)
	at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.drain(MonoIgnoreThen.java:135)
	at reactor.core.publisher.MonoIgnoreThen.subscribe(MonoIgnoreThen.java:56)
	at reactor.core.publisher.Mono.subscribe(Mono.java:4213)
	at reactor.core.publisher.Mono.subscribeWith(Mono.java:4324)
	at reactor.core.publisher.Mono.toFuture(Mono.java:4658)
	at org.springframework.ide.vscode.commons.languageserver.util.SimpleLanguageServer.doOnInitialized(SimpleLanguageServer.java:759)
	at org.springframework.ide.vscode.boot.jdt.ls.JdtLsProjectCache$JstLsClasspathListener.changed(JdtLsProjectCache.java:330)
	at org.springframework.ide.vscode.commons.languageserver.java.ls.ClasspathListenerManager.lambda$addClasspathListener$0(ClasspathListenerManager.java:91)
	at org.springframework.ide.vscode.commons.languageserver.java.ls.ClasspathListenerManager$$Lambda$453/0x0000000800436440.call(Unknown Source)
	at reactor.core.publisher.MonoCallable.call(MonoCallable.java:91)
	at reactor.core.publisher.MonoCallableOnAssembly.call(MonoCallableOnAssembly.java:90)
	at reactor.core.publisher.FluxSubscribeOnCallable$CallableSubscribeOnSubscription.run(FluxSubscribeOnCallable.java:225)
	at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:68)
	at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:28)
	at java.util.concurrent.FutureTask.run([email protected]/FutureTask.java:264)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run([email protected]/ScheduledThreadPoolExecutor.java:304)
	at java.util.concurrent.ThreadPoolExecutor.runWorker([email protected]/ThreadPoolExecutor.java:1128)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run([email protected]/ThreadPoolExecutor.java:628)
	at java.lang.Thread.run([email protected]/Thread.java:834)

"Reconciler-1" #28 prio=5 os_prio=31 cpu=42.63ms elapsed=600368.20s tid=0x00007fe8e4305800 nid=0x8b03 waiting on condition  [0x000070000d8aa000]
   java.lang.Thread.State: WAITING (parking)
	at jdk.internal.misc.Unsafe.park([email protected]/Native Method)
	- parking to wait for  <0x00000007bc341740> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
	at java.util.concurrent.locks.LockSupport.park([email protected]/LockSupport.java:194)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await([email protected]/AbstractQueuedSynchronizer.java:2081)
	at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take([email protected]/ScheduledThreadPoolExecutor.java:1170)
	at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take([email protected]/ScheduledThreadPoolExecutor.java:899)
	at java.util.concurrent.ThreadPoolExecutor.getTask([email protected]/ThreadPoolExecutor.java:1054)
	at java.util.concurrent.ThreadPoolExecutor.runWorker([email protected]/ThreadPoolExecutor.java:1114)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run([email protected]/ThreadPoolExecutor.java:628)
	at java.lang.Thread.run([email protected]/Thread.java:834)

"parallel-1" #29 daemon prio=5 os_prio=31 cpu=0.39ms elapsed=600368.16s tid=0x00007fe8e433a000 nid=0x6b03 waiting on condition  [0x000070000d9ad000]
   java.lang.Thread.State: WAITING (parking)
	at jdk.internal.misc.Unsafe.park([email protected]/Native Method)
	- parking to wait for  <0x00000007bc34e868> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
	at java.util.concurrent.locks.LockSupport.park([email protected]/LockSupport.java:194)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await([email protected]/AbstractQueuedSynchronizer.java:2081)
	at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take([email protected]/ScheduledThreadPoolExecutor.java:1170)
	at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take([email protected]/ScheduledThreadPoolExecutor.java:899)
	at java.util.concurrent.ThreadPoolExecutor.getTask([email protected]/ThreadPoolExecutor.java:1054)
	at java.util.concurrent.ThreadPoolExecutor.runWorker([email protected]/ThreadPoolExecutor.java:1114)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run([email protected]/ThreadPoolExecutor.java:628)
	at java.lang.Thread.run([email protected]/Thread.java:834)

"ForkJoinPool.commonPool-worker-19" #30 daemon prio=5 os_prio=31 cpu=3817.43ms elapsed=600368.15s tid=0x00007fe8e3bda800 nid=0x6e03 waiting for monitor entry  [0x000070000dab0000]
   java.lang.Thread.State: BLOCKED (on object monitor)
	at org.springframework.ide.vscode.boot.jdt.ls.JdtLsProjectCache.find(JdtLsProjectCache.java:201)
	- waiting to lock <0x00000007bc327670> (a java.util.HashMap)
	at org.springframework.ide.vscode.commons.languageserver.java.FutureProjectFinder.findFuture(FutureProjectFinder.java:91)
	- locked <0x00000007bc3277c8> (a org.springframework.ide.vscode.commons.languageserver.java.FutureProjectFinder)
	at org.springframework.ide.vscode.boot.app.SpringSymbolIndex.getSymbols(SpringSymbolIndex.java:550)
	at org.springframework.ide.vscode.boot.java.handlers.BootJavaDocumentSymbolHandler.handle(BootJavaDocumentSymbolHandler.java:33)
	at org.springframework.ide.vscode.commons.languageserver.util.SimpleTextDocumentService.lambda$documentSymbol$9(SimpleTextDocumentService.java:395)
	at org.springframework.ide.vscode.commons.languageserver.util.SimpleTextDocumentService$$Lambda$442/0x0000000800432840.apply(Unknown Source)
	at java.util.concurrent.CompletableFuture$UniApply.tryFire([email protected]/CompletableFuture.java:642)
	at java.util.concurrent.CompletableFuture$Completion.exec([email protected]/CompletableFuture.java:479)
	at java.util.concurrent.ForkJoinTask.doExec([email protected]/ForkJoinTask.java:290)
	at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec([email protected]/ForkJoinPool.java:1020)
	at java.util.concurrent.ForkJoinPool.scan([email protected]/ForkJoinPool.java:1656)
	at java.util.concurrent.ForkJoinPool.runWorker([email protected]/ForkJoinPool.java:1594)
	at java.util.concurrent.ForkJoinWorkerThread.run([email protected]/ForkJoinWorkerThread.java:183)

"ForkJoinPool.commonPool-worker-5" #31 daemon prio=5 os_prio=31 cpu=2.83ms elapsed=600368.15s tid=0x00007fe8e3c92800 nid=0x8803 waiting for monitor entry  [0x000070000dbb3000]
   java.lang.Thread.State: BLOCKED (on object monitor)
	at org.springframework.ide.vscode.boot.jdt.ls.JdtLsProjectCache.find(JdtLsProjectCache.java:201)
	- waiting to lock <0x00000007bc327670> (a java.util.HashMap)
	at org.springframework.ide.vscode.boot.metadata.DefaultSpringPropertyIndexProvider.getIndex(DefaultSpringPropertyIndexProvider.java:45)
	at org.springframework.ide.vscode.boot.properties.hover.PropertiesHoverInfoProvider.getHoverInfo(PropertiesHoverInfoProvider.java:41)
	at org.springframework.ide.vscode.boot.properties.BootPropertiesLanguageServerComponents.lambda$getHoverProvider$5(BootPropertiesLanguageServerComponents.java:125)
	at org.springframework.ide.vscode.boot.properties.BootPropertiesLanguageServerComponents$$Lambda$491/0x00000008004a6840.getHoverInfo(Unknown Source)
	at org.springframework.ide.vscode.commons.languageserver.hover.VscodeHoverEngineAdapter.handle(VscodeHoverEngineAdapter.java:73)
	at org.springframework.ide.vscode.commons.languageserver.composable.CompositeLanguageServerComponents$2.handle(CompositeLanguageServerComponents.java:92)
	at org.springframework.ide.vscode.commons.languageserver.util.SimpleTextDocumentService.computeHover(SimpleTextDocumentService.java:313)
	at org.springframework.ide.vscode.commons.languageserver.util.SimpleTextDocumentService.lambda$hover$3(SimpleTextDocumentService.java:292)
	at org.springframework.ide.vscode.commons.languageserver.util.SimpleTextDocumentService$$Lambda$490/0x00000008004a7440.apply(Unknown Source)
	at java.util.concurrent.CompletableFuture$UniApply.tryFire([email protected]/CompletableFuture.java:642)
	at java.util.concurrent.CompletableFuture$Completion.exec([email protected]/CompletableFuture.java:479)
	at java.util.concurrent.ForkJoinTask.doExec([email protected]/ForkJoinTask.java:290)
	at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec([email protected]/ForkJoinPool.java:1020)
	at java.util.concurrent.ForkJoinPool.scan([email protected]/ForkJoinPool.java:1656)
	at java.util.concurrent.ForkJoinPool.runWorker([email protected]/ForkJoinPool.java:1594)
	at java.util.concurrent.ForkJoinWorkerThread.run([email protected]/ForkJoinWorkerThread.java:183)

"ForkJoinPool.commonPool-worker-23" #32 daemon prio=5 os_prio=31 cpu=0.13ms elapsed=600335.40s tid=0x00007fe8e3c7d000 nid=0x7003 waiting for monitor entry  [0x000070000dcb6000]
   java.lang.Thread.State: BLOCKED (on object monitor)
	at org.springframework.ide.vscode.commons.languageserver.java.FutureProjectFinder.findFuture(FutureProjectFinder.java:90)
	- waiting to lock <0x00000007bc3277c8> (a org.springframework.ide.vscode.commons.languageserver.java.FutureProjectFinder)
	at org.springframework.ide.vscode.boot.app.SpringSymbolIndex.getSymbols(SpringSymbolIndex.java:550)
	at org.springframework.ide.vscode.boot.java.handlers.BootJavaDocumentSymbolHandler.handle(BootJavaDocumentSymbolHandler.java:33)
	at org.springframework.ide.vscode.commons.languageserver.util.SimpleTextDocumentService.lambda$documentSymbol$9(SimpleTextDocumentService.java:395)
	at org.springframework.ide.vscode.commons.languageserver.util.SimpleTextDocumentService$$Lambda$442/0x0000000800432840.apply(Unknown Source)
	at java.util.concurrent.CompletableFuture$UniApply.tryFire([email protected]/CompletableFuture.java:642)
	at java.util.concurrent.CompletableFuture$Completion.exec([email protected]/CompletableFuture.java:479)
	at java.util.concurrent.ForkJoinTask.doExec([email protected]/ForkJoinTask.java:290)
	at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec([email protected]/ForkJoinPool.java:1020)
	at java.util.concurrent.ForkJoinPool.scan([email protected]/ForkJoinPool.java:1656)
	at java.util.concurrent.ForkJoinPool.runWorker([email protected]/ForkJoinPool.java:1594)
	at java.util.concurrent.ForkJoinWorkerThread.run([email protected]/ForkJoinWorkerThread.java:183)

"Attach Listener" #33 daemon prio=9 os_prio=31 cpu=149.11ms elapsed=600326.60s tid=0x00007fe8e21d9800 nid=0x660b waiting on condition  [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"SIGTERM handler" #34 daemon prio=9 os_prio=31 cpu=6.66ms elapsed=93.57s tid=0x00007fe8e4300000 nid=0x8f07 in Object.wait()  [0x000070000d6a4000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait([email protected]/Native Method)
	- waiting on <no object reference available>
	at java.lang.Thread.join([email protected]/Thread.java:1305)
	- waiting to re-lock in wait() <0x00000007bbf02170> (a org.springframework.context.support.AbstractApplicationContext$1)
	at java.lang.Thread.join([email protected]/Thread.java:1379)
	at java.lang.ApplicationShutdownHooks.runHooks([email protected]/ApplicationShutdownHooks.java:107)
	at java.lang.ApplicationShutdownHooks$1.run([email protected]/ApplicationShutdownHooks.java:46)
	at java.lang.Shutdown.runHooks([email protected]/Shutdown.java:130)
	at java.lang.Shutdown.exit([email protected]/Shutdown.java:174)
	- locked <0x00000007800b8408> (a java.lang.Class for java.lang.Shutdown)
	at java.lang.Terminator$1.handle([email protected]/Terminator.java:51)
	at jdk.internal.misc.Signal$1.run([email protected]/Signal.java:220)
	at java.lang.Thread.run([email protected]/Thread.java:834)

"SpringContextShutdownHook" #22 prio=5 os_prio=31 cpu=59.39ms elapsed=93.53s tid=0x00007fe8e2193000 nid=0x8303 waiting for monitor entry  [0x000070000debc000]
   java.lang.Thread.State: BLOCKED (on object monitor)
	at org.springframework.ide.vscode.boot.jdt.ls.JdtLsProjectCache.removeListener(JdtLsProjectCache.java:111)
	- waiting to lock <0x00000007bc338180> (a java.util.ArrayList)
	at org.springframework.ide.vscode.commons.languageserver.java.FutureProjectFinder.destroy(FutureProjectFinder.java:85)
	at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:258)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:587)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:559)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingleton(DefaultListableBeanFactory.java:1092)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:520)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingletons(DefaultListableBeanFactory.java:1085)
	at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1061)
	at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1030)
	at org.springframework.context.support.AbstractApplicationContext$1.run(AbstractApplicationContext.java:949)
	- locked <0x0000000780066d20> (a java.lang.Object)

"SIGTERM handler" #35 daemon prio=9 os_prio=31 cpu=2.43ms elapsed=69.46s tid=0x00007fe8e2173000 nid=0x8407 waiting for monitor entry  [0x000070000ddb9000]
   java.lang.Thread.State: BLOCKED (on object monitor)
	at java.lang.Shutdown.exit([email protected]/Shutdown.java:173)
	- waiting to lock <0x00000007800b8408> (a java.lang.Class for java.lang.Shutdown)
	at java.lang.Terminator$1.handle([email protected]/Terminator.java:51)
	at jdk.internal.misc.Signal$1.run([email protected]/Signal.java:220)
	at java.lang.Thread.run([email protected]/Thread.java:834)

"VM Thread" os_prio=31 cpu=3847.94ms elapsed=600369.97s tid=0x00007fe8e201a800 nid=0x4703 runnable  

"GC Thread#0" os_prio=31 cpu=25.00ms elapsed=600369.98s tid=0x00007fe8e3810800 nid=0x5203 runnable  

"GC Thread#1" os_prio=31 cpu=21.25ms elapsed=600369.05s tid=0x00007fe8e210c800 nid=0x5d07 runnable  

"GC Thread#2" os_prio=31 cpu=19.36ms elapsed=600369.05s tid=0x00007fe8e2101800 nid=0x5c07 runnable  

"GC Thread#3" os_prio=31 cpu=21.17ms elapsed=600369.05s tid=0x00007fe8e40be800 nid=0x5f03 runnable  

"GC Thread#4" os_prio=31 cpu=20.53ms elapsed=600369.05s tid=0x00007fe8e2157800 nid=0xa103 runnable  

"GC Thread#5" os_prio=31 cpu=20.53ms elapsed=600369.05s tid=0x00007fe8e2158800 nid=0x9f03 runnable  

"GC Thread#6" os_prio=31 cpu=21.53ms elapsed=600369.05s tid=0x00007fe8e424a000 nid=0x9d03 runnable  

"GC Thread#7" os_prio=31 cpu=20.55ms elapsed=600369.05s tid=0x00007fe8e4231800 nid=0x9b03 runnable  

"GC Thread#8" os_prio=31 cpu=18.98ms elapsed=600369.05s tid=0x00007fe8e428c800 nid=0x9903 runnable  

"GC Thread#9" os_prio=31 cpu=21.19ms elapsed=600369.05s tid=0x00007fe8e425c800 nid=0x9703 runnable  

"GC Thread#10" os_prio=31 cpu=21.38ms elapsed=600369.05s tid=0x00007fe8e429c000 nid=0x6003 runnable  

"GC Thread#11" os_prio=31 cpu=20.00ms elapsed=600369.05s tid=0x00007fe8e429c800 nid=0x9403 runnable  

"GC Thread#12" os_prio=31 cpu=19.76ms elapsed=600369.05s tid=0x00007fe8e4276000 nid=0x6203 runnable  

"G1 Main Marker" os_prio=31 cpu=0.61ms elapsed=600369.98s tid=0x00007fe8e3835800 nid=0x5003 runnable  

"G1 Conc#0" os_prio=31 cpu=18.57ms elapsed=600369.98s tid=0x00007fe8e3836800 nid=0x4d03 runnable  

"G1 Conc#1" os_prio=31 cpu=18.70ms elapsed=600368.96s tid=0x00007fe8e42b6000 nid=0x6403 runnable  

"G1 Conc#2" os_prio=31 cpu=18.06ms elapsed=600368.96s tid=0x00007fe8e42ba800 nid=0x9203 runnable  

"G1 Refine#0" os_prio=31 cpu=0.36ms elapsed=600369.98s tid=0x00007fe8e4821000 nid=0x4c03 runnable  

"G1 Young RemSet Sampling" os_prio=31 cpu=20512.03ms elapsed=600369.98s tid=0x00007fe8e2014800 nid=0x4b03 runnable  
"VM Periodic Task Thread" os_prio=31 cpu=74264.23ms elapsed=600369.91s tid=0x00007fe8e400f000 nid=0x5a03 waiting on condition  

JNI global refs: 23, weak refs: 0


Found one Java-level deadlock:
=============================
"Simple-Language-Server main thread":
  waiting to lock monitor 0x00007fe8b800de00 (object 0x00000007bc3277c8, a org.springframework.ide.vscode.commons.languageserver.java.FutureProjectFinder),
  which is held by "ForkJoinPool.commonPool-worker-19"
"ForkJoinPool.commonPool-worker-19":
  waiting to lock monitor 0x00007fe8b800dd00 (object 0x00000007bc327670, a java.util.HashMap),
  which is held by "Simple-Language-Server main thread"

Java stack information for the threads listed above:
===================================================
"Simple-Language-Server main thread":
	at org.springframework.ide.vscode.commons.languageserver.java.FutureProjectFinder.resolvePendingRequests(FutureProjectFinder.java:73)
	- waiting to lock <0x00000007bc3277c8> (a org.springframework.ide.vscode.commons.languageserver.java.FutureProjectFinder)
	at org.springframework.ide.vscode.commons.languageserver.java.FutureProjectFinder$1.created(FutureProjectFinder.java:39)
	at org.springframework.ide.vscode.boot.jdt.ls.JdtLsProjectCache.notifyCreated(JdtLsProjectCache.java:124)
	- locked <0x00000007bc338180> (a java.util.ArrayList)
	at org.springframework.ide.vscode.boot.jdt.ls.JdtLsProjectCache$JstLsClasspathListener.lambda$changed$0(JdtLsProjectCache.java:357)
	- locked <0x00000007bc327670> (a java.util.HashMap)
	at org.springframework.ide.vscode.boot.jdt.ls.JdtLsProjectCache$JstLsClasspathListener$$Lambda$454/0x0000000800435840.run(Unknown Source)
	at reactor.core.publisher.MonoRunnable.call(MonoRunnable.java:73)
	at reactor.core.publisher.MonoRunnable.call(MonoRunnable.java:32)
	at reactor.core.publisher.MonoCallableOnAssembly.call(MonoCallableOnAssembly.java:90)
	at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.drain(MonoIgnoreThen.java:135)
	at reactor.core.publisher.MonoIgnoreThen.subscribe(MonoIgnoreThen.java:56)
	at reactor.core.publisher.Mono.subscribe(Mono.java:4213)
	at reactor.core.publisher.Mono.subscribeWith(Mono.java:4324)
	at reactor.core.publisher.Mono.toFuture(Mono.java:4658)
	at org.springframework.ide.vscode.commons.languageserver.util.SimpleLanguageServer.doOnInitialized(SimpleLanguageServer.java:759)
	at org.springframework.ide.vscode.boot.jdt.ls.JdtLsProjectCache$JstLsClasspathListener.changed(JdtLsProjectCache.java:330)
	at org.springframework.ide.vscode.commons.languageserver.java.ls.ClasspathListenerManager.lambda$addClasspathListener$0(ClasspathListenerManager.java:91)
	at org.springframework.ide.vscode.commons.languageserver.java.ls.ClasspathListenerManager$$Lambda$453/0x0000000800436440.call(Unknown Source)
	at reactor.core.publisher.MonoCallable.call(MonoCallable.java:91)
	at reactor.core.publisher.MonoCallableOnAssembly.call(MonoCallableOnAssembly.java:90)
	at reactor.core.publisher.FluxSubscribeOnCallable$CallableSubscribeOnSubscription.run(FluxSubscribeOnCallable.java:225)
	at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:68)
	at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:28)
	at java.util.concurrent.FutureTask.run([email protected]/FutureTask.java:264)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run([email protected]/ScheduledThreadPoolExecutor.java:304)
	at java.util.concurrent.ThreadPoolExecutor.runWorker([email protected]/ThreadPoolExecutor.java:1128)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run([email protected]/ThreadPoolExecutor.java:628)
	at java.lang.Thread.run([email protected]/Thread.java:834)
"ForkJoinPool.commonPool-worker-19":
	at org.springframework.ide.vscode.boot.jdt.ls.JdtLsProjectCache.find(JdtLsProjectCache.java:201)
	- waiting to lock <0x00000007bc327670> (a java.util.HashMap)
	at org.springframework.ide.vscode.commons.languageserver.java.FutureProjectFinder.findFuture(FutureProjectFinder.java:91)
	- locked <0x00000007bc3277c8> (a org.springframework.ide.vscode.commons.languageserver.java.FutureProjectFinder)
	at org.springframework.ide.vscode.boot.app.SpringSymbolIndex.getSymbols(SpringSymbolIndex.java:550)
	at org.springframework.ide.vscode.boot.java.handlers.BootJavaDocumentSymbolHandler.handle(BootJavaDocumentSymbolHandler.java:33)
	at org.springframework.ide.vscode.commons.languageserver.util.SimpleTextDocumentService.lambda$documentSymbol$9(SimpleTextDocumentService.java:395)
	at org.springframework.ide.vscode.commons.languageserver.util.SimpleTextDocumentService$$Lambda$442/0x0000000800432840.apply(Unknown Source)
	at java.util.concurrent.CompletableFuture$UniApply.tryFire([email protected]/CompletableFuture.java:642)
	at java.util.concurrent.CompletableFuture$Completion.exec([email protected]/CompletableFuture.java:479)
	at java.util.concurrent.ForkJoinTask.doExec([email protected]/ForkJoinTask.java:290)
	at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec([email protected]/ForkJoinPool.java:1020)
	at java.util.concurrent.ForkJoinPool.scan([email protected]/ForkJoinPool.java:1656)
	at java.util.concurrent.ForkJoinPool.runWorker([email protected]/ForkJoinPool.java:1594)
	at java.util.concurrent.ForkJoinWorkerThread.run([email protected]/ForkJoinWorkerThread.java:183)

Found 1 deadlock.

Activity

  1. martinlippert commented on Mar 1, 2022

    @martinlippert
    MemberAuthor
  2. added this to the 4.14.0.RELEASE milestone on Mar 1, 2022
  3. BoykoAlex commented on Mar 1, 2022

    @BoykoAlex
    Contributor

    @martinlippert I have seen the same. We need a finer grain locking in FutureProjectFinder such that it does not lock out the JdtLsProjectCache.
    Lets check how this db2f622 helps

  4. BoykoAlex commented on Mar 1, 2022

    @BoykoAlex
    Contributor

    @martinlippert look like the deadlock is solved. However, I still get the Boot LS process not shut down. The threads dump is:
    sts4-shutdown.txt

    As you can see there is no deadlock. The server never received the shutdown request (same noticed while debugging)
    I laso see Java LS not being shut down. There are 2 cases I've noticed:

    • Complete VSCode close which doesn't shut down Java LS immediately but rather after 5-10 sec
    • "Sleep" mode (Click on the red circle in mac osx. See the dot under VSCode in the dock bar). Java LS process stays around in this case until VSCode is started again in which case it kills the old Java LS process and creates the new one
  5. BoykoAlex commented on Mar 10, 2022

    @BoykoAlex
    Contributor

    Fixed LS not shut down after VSCode is shut down with a588354 (took JDT LS and XML LS solutions)

  6. martinlippert commented on Mar 10, 2022

    @martinlippert
    MemberAuthor

    @BoykoAlex The fix that you implemented looks like it might also solve #704. Is that correct? If so, we could close that one as well with a reference to the fix commit... :-)

  7. BoykoAlex commented on Mar 10, 2022

    @BoykoAlex
    Contributor

    @martinlippert Yes, i think this is it for #704 - I'll put a comment and close that issue

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions