Async autocompletion (CompletionContribitor)

Hello,

I would like to implement a CompletionContributor that autocompletes async. Does anyone know the appropriate of doing this?

thanks in advance

9 comments
Comment actions Permalink

The UI is frozen because the completion thread is holding read action and doesn't release it. To make the UI responsive please ensure you periodically (e.g. every 10ms) invoke ProgressManager.checkCanceled. Then IDEA will be able to throw ProcessCanceledException, thus ending your contributor (and all others) and let the UI thread proceed.

Side note: you shouldn't extend DefaultCompletionContributor, there's no use in it. Just extend CompletionContributor itself.

1
Comment actions Permalink

What do you mean by "autocompletes async"? All CompletionContributors are called in a background thread.

0
Comment actions Permalink

I am working on plugin that manages an immense database with an awfull lot of database objects (thousands of tables,triggers and storred procedures). The plugin has a query panel that has autocomplete, it gets it possible completions from the object names of this database. Whenever the server respons slow, internet is down or whenever de CompletionContributor does not respond, the query editor hangs.

0
Comment actions Permalink

Can you take a thread dump during the hang and post it here? If the plugin is implemented correctly, the completion variants will appear with a delay, but the editor should remain responsive, and the user should be able to accept the completion variants which are already displayed, dismiss the completion list, continue editing etc.

0
Comment actions Permalink

Sorry for the slow reply, i was working on some other stuff.
I placed a Thread.sleep in my CompletionContributor to simulate internet hanging.

"AWT-EventQueue-1 14.0.3#IU-139.1117.1, eap:false@2207" prio=6 tid=0x1d nid=NA waiting
  java.lang.Thread.State: WAITING
   at sun.misc.Unsafe.park(Unsafe.java:-1)
   at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
   at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:747)
   at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireInterruptibly(AbstractQueuedSynchronizer.java:803)
   at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireInterruptibly(AbstractQueuedSynchronizer.java:1137)
   at java.util.concurrent.locks.ReentrantReadWriteLock$WriteLock.lockInterruptibly(ReentrantReadWriteLock.java:862)
   at com.intellij.openapi.application.impl.ApplicationImpl$WriteAccessToken.<init>(ApplicationImpl.java:1247)
   at com.intellij.openapi.application.impl.ApplicationImpl.acquireWriteActionLock(ApplicationImpl.java:1204)
   at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:975)
   at com.intellij.openapi.editor.actionSystem.TypedAction$TypingCommand.run(TypedAction.java:127)
   at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:124)
   at com.intellij.openapi.editor.actionSystem.TypedAction.actionPerformed(TypedAction.java:107)
   at com.intellij.openapi.editor.impl.EditorImpl.a(EditorImpl.java:1037)
   at com.intellij.openapi.editor.impl.EditorImpl.processKeyTyped(EditorImpl.java:5135)
   at com.intellij.openapi.editor.impl.EditorImpl$11.keyTyped(EditorImpl.java:880)
   at java.awt.Component.processKeyEvent(Component.java:6218)
   at javax.swing.JComponent.processKeyEvent(JComponent.java:2801)
   at java.awt.Component.processEvent(Component.java:6040)
   at java.awt.Container.processEvent(Container.java:2041)
   at java.awt.Component.dispatchEventImpl(Component.java:4630)
   at java.awt.Container.dispatchEventImpl(Container.java:2099)
   at java.awt.Component.dispatchEvent(Component.java:4460)
   at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1850)
   at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:712)
   at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:990)
   at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:855)
   at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:676)
   at java.awt.Component.dispatchEventImpl(Component.java:4502)
   at java.awt.Container.dispatchEventImpl(Container.java:2099)
   at java.awt.Window.dispatchEventImpl(Window.java:2478)
   at java.awt.Component.dispatchEvent(Component.java:4460)
   at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
   at com.intellij.ide.IdeEventQueue.e(IdeEventQueue.java:748)
   at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:547)
   at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:384)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
   at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
   at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

0
Comment actions Permalink

I need a thread dump from all the threads, not just from the EDT. This thread dump only shows that the EDT is hanging because another thread is holding the read action lock, but it doesn't show where exactly that lock was taken.

0
Comment actions Permalink

Full thread dump

"AWT-EventQueue-1 14.0.3#IU-139.1117.1, eap:false@2207" prio=6 tid=0x1d nid=NA waiting
  java.lang.Thread.State: WAITING
   at sun.misc.Unsafe.park(Unsafe.java:-1)
   at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
   at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:747)
   at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireInterruptibly(AbstractQueuedSynchronizer.java:803)
   at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireInterruptibly(AbstractQueuedSynchronizer.java:1137)
   at java.util.concurrent.locks.ReentrantReadWriteLock$WriteLock.lockInterruptibly(ReentrantReadWriteLock.java:862)
   at com.intellij.openapi.application.impl.ApplicationImpl$WriteAccessToken.<init>(ApplicationImpl.java:1247)
   at com.intellij.openapi.application.impl.ApplicationImpl.acquireWriteActionLock(ApplicationImpl.java:1204)
   at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:975)
   at com.intellij.openapi.editor.actionSystem.TypedAction$TypingCommand.run(TypedAction.java:127)
   at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:124)
   at com.intellij.openapi.editor.actionSystem.TypedAction.actionPerformed(TypedAction.java:107)
   at com.intellij.openapi.editor.impl.EditorImpl.a(EditorImpl.java:1037)
   at com.intellij.openapi.editor.impl.EditorImpl.processKeyTyped(EditorImpl.java:5135)
   at com.intellij.openapi.editor.impl.EditorImpl$11.keyTyped(EditorImpl.java:880)
   at java.awt.Component.processKeyEvent(Component.java:6218)
   at javax.swing.JComponent.processKeyEvent(JComponent.java:2801)
   at java.awt.Component.processEvent(Component.java:6040)
   at java.awt.Container.processEvent(Container.java:2041)
   at java.awt.Component.dispatchEventImpl(Component.java:4630)
   at java.awt.Container.dispatchEventImpl(Container.java:2099)
   at java.awt.Component.dispatchEvent(Component.java:4460)
   at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1850)
   at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:712)
   at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:990)
   at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:855)
   at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:676)
   at java.awt.Component.dispatchEventImpl(Component.java:4502)
   at java.awt.Container.dispatchEventImpl(Container.java:2099)
   at java.awt.Window.dispatchEventImpl(Window.java:2478)
   at java.awt.Component.dispatchEvent(Component.java:4460)
   at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
   at com.intellij.ide.IdeEventQueue.e(IdeEventQueue.java:748)
   at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:547)
   at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:384)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
   at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
   at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

"ApplicationImpl pooled thread 10@18451" daemon prio=4 tid=0x15d nid=NA waiting
  java.lang.Thread.State: WAITING
   at sun.misc.Unsafe.park(Unsafe.java:-1)
   at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
   at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:747)
   at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(AbstractQueuedSynchronizer.java:905)
   at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1217)
   at java.util.concurrent.locks.ReentrantReadWriteLock$ReadLock.lockInterruptibly(ReentrantReadWriteLock.java:639)
   at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:924)
   at com.intellij.openapi.vcs.changes.conflicts.ChangelistConflictTracker$1.run(ChangelistConflictTracker.java:85)
   at com.intellij.openapi.vcs.ZipperUpdater$1.run(ZipperUpdater.java:64)
   at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:238)
   at com.intellij.util.Alarm$Request$1.run(Alarm.java:351)
   at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
   at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
   at java.util.concurrent.FutureTask.run(FutureTask.java:138)
   at com.intellij.util.concurrency.QueueProcessor$RunnableConsumer.consume(QueueProcessor.java:298)
   at com.intellij.util.concurrency.QueueProcessor$RunnableConsumer.consume(QueueProcessor.java:295)
   at com.intellij.util.concurrency.QueueProcessor$2$1.run(QueueProcessor.java:110)
   at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:238)
   at com.intellij.util.concurrency.QueueProcessor$2.consume(QueueProcessor.java:107)
   at com.intellij.util.concurrency.QueueProcessor$2.consume(QueueProcessor.java:104)
   at com.intellij.util.concurrency.QueueProcessor$3$1.run(QueueProcessor.java:215)
   at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:238)
   at com.intellij.util.concurrency.QueueProcessor$3.run(QueueProcessor.java:212)
   at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:406)
   at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
   at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
   at java.util.concurrent.FutureTask.run(FutureTask.java:138)
   at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
   at java.lang.Thread.run(Thread.java:619)
   at org.jetbrains.ide.PooledThreadExecutor$1$1.run(PooledThreadExecutor.java:56)

"Alarm pool(shared)@5651" daemon prio=3 tid=0x2e nid=NA waiting
  java.lang.Thread.State: WAITING
   at sun.misc.Unsafe.park(Unsafe.java:-1)
   at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
   at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:747)
   at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(AbstractQueuedSynchronizer.java:905)
   at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1217)
   at java.util.concurrent.locks.ReentrantReadWriteLock$ReadLock.lockInterruptibly(ReentrantReadWriteLock.java:639)
   at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:924)
   at com.intellij.openapi.application.ReadAction.execute(ReadAction.java:26)
   at com.intellij.ide.GeneratedSourceFileChangeTrackerImpl.a(GeneratedSourceFileChangeTrackerImpl.java:121)
   at com.intellij.ide.GeneratedSourceFileChangeTrackerImpl.access$000(GeneratedSourceFileChangeTrackerImpl.java:45)
   at com.intellij.ide.GeneratedSourceFileChangeTrackerImpl$1.run(GeneratedSourceFileChangeTrackerImpl.java:69)
   at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:320)
   at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:310)
   at com.intellij.util.ui.update.MergingUpdateQueue$2.run(MergingUpdateQueue.java:254)
   at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:269)
   at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:227)
   at com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue.java:217)
   at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:238)
   at com.intellij.util.Alarm$Request$1.run(Alarm.java:351)
   at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
   at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
   at java.util.concurrent.FutureTask.run(FutureTask.java:138)
   at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
   at java.lang.Thread.run(Thread.java:619)

"ApplicationImpl pooled thread 9@11871" prio=4 tid=0x3b nid=NA runnable
  java.lang.Thread.State: RUNNABLE
   at sun.nio.ch.WindowsSelectorImpl$SubSelector.poll0(WindowsSelectorImpl.java:-1)
   at sun.nio.ch.WindowsSelectorImpl$SubSelector.poll(WindowsSelectorImpl.java:273)
   at sun.nio.ch.WindowsSelectorImpl$SubSelector.access$400(WindowsSelectorImpl.java:255)
   at sun.nio.ch.WindowsSelectorImpl.doSelect(WindowsSelectorImpl.java:136)
   at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:69)
   - locked <0x43bf> (a sun.nio.ch.WindowsSelectorImpl)
   - locked <0x43c0> (a java.util.Collections$UnmodifiableSet)
   - locked <0x43c1> (a io.netty.channel.nio.SelectedSelectionKeySet)
   at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:80)
   at io.netty.channel.nio.NioEventLoop.select(NioEventLoop.java:621)
   at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:309)
   at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:834)
   at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
   at java.lang.Thread.run(Thread.java:619)
   at org.jetbrains.ide.PooledThreadExecutor$1$1.run(PooledThreadExecutor.java:56)

"ApplicationImpl pooled thread 1@3165" prio=4 tid=0x22 nid=NA runnable
  java.lang.Thread.State: RUNNABLE
   at java.lang.ProcessImpl.waitFor(ProcessImpl.java:-1)
   at com.intellij.execution.process.ProcessWaitFor$1.run(ProcessWaitFor.java:30)
   at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:406)
   at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
   at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
   at java.util.concurrent.FutureTask.run(FutureTask.java:138)
   at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
   at java.lang.Thread.run(Thread.java:619)
   at org.jetbrains.ide.PooledThreadExecutor$1$1.run(PooledThreadExecutor.java:56)

"ApplicationImpl pooled thread 12@18457" daemon prio=4 tid=0x15f nid=NA waiting
  java.lang.Thread.State: WAITING
   at sun.misc.Unsafe.park(Unsafe.java:-1)
   at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:198)
   at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:424)
   at java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:323)
   at java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:874)
   at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:945)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
   at java.lang.Thread.run(Thread.java:619)
   at org.jetbrains.ide.PooledThreadExecutor$1$1.run(PooledThreadExecutor.java:56)

"ApplicationImpl pooled thread 11@18456" prio=4 tid=0x15e nid=NA waiting
  java.lang.Thread.State: WAITING
   at sun.misc.Unsafe.park(Unsafe.java:-1)
   at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:198)
   at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:424)
   at java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:323)
   at java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:874)
   at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:945)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
   at java.lang.Thread.run(Thread.java:619)
   at org.jetbrains.ide.PooledThreadExecutor$1$1.run(PooledThreadExecutor.java:56)

"Change List Updater@15803" daemon prio=2 tid=0x43 nid=NA waiting
  java.lang.Thread.State: WAITING
   at sun.misc.Unsafe.park(Unsafe.java:-1)
   at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
   at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1925)
   at java.util.concurrent.DelayQueue.take(DelayQueue.java:160)
   at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:583)
   at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:576)
   at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
   at java.lang.Thread.run(Thread.java:619)

"Encoding detection thread@10189" daemon prio=5 tid=0x35 nid=NA waiting
  java.lang.Thread.State: WAITING
   at sun.misc.Unsafe.park(Unsafe.java:-1)
   at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
   at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1925)
   at java.util.concurrent.DelayQueue.take(DelayQueue.java:160)
   at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:583)
   at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:576)
   at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
   at java.lang.Thread.run(Thread.java:619)

"Animations@5641" daemon prio=5 tid=0x2d nid=NA waiting
  java.lang.Thread.State: WAITING
   at sun.misc.Unsafe.park(Unsafe.java:-1)
   at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
   at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1925)
   at java.util.concurrent.DelayQueue.take(DelayQueue.java:160)
   at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:583)
   at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:576)
   at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
   at java.lang.Thread.run(Thread.java:619)

"Performance watcher@3913" prio=1 tid=0x27 nid=NA waiting
  java.lang.Thread.State: WAITING
   at sun.misc.Unsafe.park(Unsafe.java:-1)
   at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:198)
   at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedNanos(AbstractQueuedSynchronizer.java:947)
   at java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireSharedNanos(AbstractQueuedSynchronizer.java:1239)
   at java.util.concurrent.Semaphore.tryAcquire(Semaphore.java:383)
   at com.intellij.diagnostic.PerformanceWatcher.c(PerformanceWatcher.java:164)
   at com.intellij.diagnostic.PerformanceWatcher.access$100(PerformanceWatcher.java:40)
   at com.intellij.diagnostic.PerformanceWatcher$2.run(PerformanceWatcher.java:117)
   at java.lang.Thread.run(Thread.java:619)

"Flushing thread@3139" daemon prio=5 tid=0x21 nid=NA waiting
  java.lang.Thread.State: WAITING
   at sun.misc.Unsafe.park(Unsafe.java:-1)
   at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:198)
   at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:1963)
   at java.util.concurrent.DelayQueue.take(DelayQueue.java:164)
   at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:583)
   at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:576)
   at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
   at java.lang.Thread.run(Thread.java:619)

"ZipFileCache Dispose@2574" daemon prio=1 tid=0x1f nid=NA waiting
  java.lang.Thread.State: WAITING
   at sun.misc.Unsafe.park(Unsafe.java:-1)
   at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:198)
   at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:1963)
   at java.util.concurrent.DelayQueue.take(DelayQueue.java:164)
   at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:583)
   at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:576)
   at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
   at java.lang.Thread.run(Thread.java:619)

"Periodic tasks thread@2127" daemon prio=5 tid=0x1c nid=NA waiting
  java.lang.Thread.State: WAITING
   at sun.misc.Unsafe.park(Unsafe.java:-1)
   at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:198)
   at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:1963)
   at java.util.concurrent.DelayQueue.take(DelayQueue.java:164)
   at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:583)
   at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:576)
   at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
   at java.lang.Thread.run(Thread.java:619)

"ZipFileCache Dispose@889" daemon prio=1 tid=0xb nid=NA waiting
  java.lang.Thread.State: WAITING
   at sun.misc.Unsafe.park(Unsafe.java:-1)
   at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:198)
   at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:1963)
   at java.util.concurrent.DelayQueue.take(DelayQueue.java:164)
   at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:583)
   at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:576)
   at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
   at java.lang.Thread.run(Thread.java:619)

"RefCountingStorage write content helper@17524" prio=6 tid=0x4b nid=NA waiting
  java.lang.Thread.State: WAITING
   at sun.misc.Unsafe.park(Unsafe.java:-1)
   at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
   at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1925)
   at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:358)
   at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
   at java.lang.Thread.run(Thread.java:619)

"EditorNotifications executor@13700" daemon prio=5 tid=0x3f nid=NA waiting
  java.lang.Thread.State: WAITING
   at sun.misc.Unsafe.park(Unsafe.java:-1)
   at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
   at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1925)
   at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:358)
   at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
   at java.lang.Thread.run(Thread.java:619)

"FS Synchronizer@12401" daemon prio=5 tid=0x3d nid=NA waiting
  java.lang.Thread.State: WAITING
   at sun.misc.Unsafe.park(Unsafe.java:-1)
   at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
   at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1925)
   at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:358)
   at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
   at java.lang.Thread.run(Thread.java:619)

"SwingWorker-pool-1-thread-1@9787" daemon prio=5 tid=0x34 nid=NA waiting
  java.lang.Thread.State: WAITING
   at sun.misc.Unsafe.park(Unsafe.java:-1)
   at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
   at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1925)
   at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:358)
   at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
   at java.lang.Thread.run(Thread.java:619)

"JobScheduler FJ pool 2/2@18539" daemon prio=6 tid=0x170 nid=NA waiting
  java.lang.Thread.State: WAITING
   at sun.misc.Unsafe.park(Unsafe.java:-1)
   at jsr166e.ForkJoinPool.awaitWork(ForkJoinPool.java:1756)
   at jsr166e.ForkJoinPool.scan(ForkJoinPool.java:1694)
   at jsr166e.ForkJoinPool.runWorker(ForkJoinPool.java:1642)
   at jsr166e.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:109)

"MessageDeliveryThread@2040" prio=5 tid=0x18 nid=NA waiting
  java.lang.Thread.State: WAITING
   at sun.misc.Unsafe.park(Unsafe.java:-1)
   at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
   at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1925)
   at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:358)
   at com.intellij.a.e.j.run(j.java:22)

"Document commit thread@4767" prio=6 tid=0x2a nid=NA waiting
  java.lang.Thread.State: WAITING
   at java.lang.Object.wait(Object.java:-1)
   at com.intellij.psi.impl.DocumentCommitThread.c(DocumentCommitThread.java:318)
   at com.intellij.psi.impl.DocumentCommitThread.run(DocumentCommitThread.java:294)
   at java.lang.Thread.run(Thread.java:619)

"Thread-8@10663" daemon prio=5 tid=0x37 nid=NA runnable
  java.lang.Thread.State: RUNNABLE
   at sun.print.Win32PrintServiceLookup.notifyPrinterChange(Win32PrintServiceLookup.java:-1)
   at sun.print.Win32PrintServiceLookup.access$100(Win32PrintServiceLookup.java:32)
   at sun.print.Win32PrintServiceLookup$PrinterChangeListener.run(Win32PrintServiceLookup.java:302)

"RMI TCP Accept-1101@12708" daemon prio=5 tid=0x3e nid=NA runnable
  java.lang.Thread.State: RUNNABLE
   at java.net.PlainSocketImpl.socketAccept(PlainSocketImpl.java:-1)
   at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:390)
   - locked <0x43bd> (a java.net.SocksSocketImpl)
   at java.net.ServerSocket.implAccept(ServerSocket.java:453)
   at java.net.ServerSocket.accept(ServerSocket.java:421)
   at sun.rmi.transport.tcp.TCPTransport$AcceptLoop.executeAcceptLoop(TCPTransport.java:369)
   at sun.rmi.transport.tcp.TCPTransport$AcceptLoop.run(TCPTransport.java:341)
   at java.lang.Thread.run(Thread.java:619)

"SocketListenerThread@2043" prio=2 tid=0x1a nid=NA runnable
  java.lang.Thread.State: RUNNABLE
   at java.net.PlainDatagramSocketImpl.receive0(PlainDatagramSocketImpl.java:-1)
   - locked <0x43c8> (a java.net.PlainDatagramSocketImpl)
   at java.net.PlainDatagramSocketImpl.receive(PlainDatagramSocketImpl.java:136)
   at java.net.DatagramSocket.receive(DatagramSocket.java:712)
   - locked <0x43c9> (a java.net.MulticastSocket)
   - locked <0x4872> (a java.net.DatagramPacket)
   at com.intellij.a.e.a.e.a(e.java:65)
   at com.intellij.a.e.a.g.run(g.java:25)

"SocketListenerThread@2041" prio=2 tid=0x19 nid=NA runnable
  java.lang.Thread.State: RUNNABLE
   at java.net.PlainDatagramSocketImpl.receive0(PlainDatagramSocketImpl.java:-1)
   - locked <0x43cb> (a java.net.PlainDatagramSocketImpl)
   at java.net.PlainDatagramSocketImpl.receive(PlainDatagramSocketImpl.java:136)
   at java.net.DatagramSocket.receive(DatagramSocket.java:712)
   - locked <0x43cc> (a java.net.DatagramSocket)
   - locked <0x4873> (a java.net.DatagramPacket)
   at com.intellij.a.e.a.e.a(e.java:65)
   at com.intellij.a.e.a.g.run(g.java:25)

"Lock thread@1283" prio=1 tid=0x13 nid=NA runnable
  java.lang.Thread.State: RUNNABLE
   at java.net.PlainSocketImpl.socketAccept(PlainSocketImpl.java:-1)
   at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:390)
   - locked <0x43cf> (a java.net.SocksSocketImpl)
   at java.net.ServerSocket.implAccept(ServerSocket.java:453)
   at java.net.ServerSocket.accept(ServerSocket.java:421)
   at com.intellij.idea.SocketLock$MyRunnable.run(SocketLock.java:224)
   at java.lang.Thread.run(Thread.java:619)

"ApplicationImpl pooled thread 7@10901" prio=4 tid=0x39 nid=NA sleeping
  java.lang.Thread.State: TIMED_WAITING
   at java.lang.Thread.sleep(Thread.java:-1)
   at uz.s9client.dbdashboard.gui.editor.DBObjectCompletionContributor.fillCompletionVariants(DBObjectCompletionContributor.java:58)
   at com.intellij.codeInsight.completion.CompletionService.getVariantsFromContributors(CompletionService.java:84)
   at com.intellij.codeInsight.completion.CompletionResultSet.runRemainingContributors(CompletionResultSet.java:135)
   at com.intellij.codeInsight.completion.CompletionResultSet.runRemainingContributors(CompletionResultSet.java:128)
   at com.intellij.codeInsight.template.impl.LiveTemplateCompletionContributor$1.addCompletions(LiveTemplateCompletionContributor.java:75)
   at com.intellij.codeInsight.completion.CompletionProvider.addCompletionVariants(CompletionProvider.java:36)
   at com.intellij.codeInsight.completion.CompletionContributor.fillCompletionVariants(CompletionContributor.java:154)
   at com.intellij.codeInsight.completion.CompletionService.getVariantsFromContributors(CompletionService.java:84)
   at com.intellij.codeInsight.completion.CompletionService.performCompletion(CompletionService.java:115)
   at com.intellij.codeInsight.completion.CompletionProgressIndicator.a(CompletionProgressIndicator.java:788)
   at com.intellij.codeInsight.completion.CompletionProgressIndicator.access$1000(CompletionProgressIndicator.java:89)
   at com.intellij.codeInsight.completion.CompletionProgressIndicator$1CalculateItems.run(CompletionProgressIndicator.java:770)
   at com.intellij.codeInsight.completion.AsyncCompletion$1$1$1.run(CompletionThreading.java:93)
   at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:908)
   at com.intellij.codeInsight.completion.AsyncCompletion$1$1.run(CompletionThreading.java:88)
   at com.intellij.openapi.progress.impl.ProgressManagerImpl$3.run(ProgressManagerImpl.java:194)
   at com.intellij.openapi.progress.impl.ProgressManagerImpl.a(ProgressManagerImpl.java:281)
   at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:233)
   at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(ProgressManagerImpl.java:181)
   at com.intellij.codeInsight.completion.AsyncCompletion$1.run(CompletionThreading.java:84)
   at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:406)
   at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
   at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
   at java.util.concurrent.FutureTask.run(FutureTask.java:138)
   at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
   at java.lang.Thread.run(Thread.java:619)
   at org.jetbrains.ide.PooledThreadExecutor$1$1.run(PooledThreadExecutor.java:56)

"StoreRefreshStatusThread@3179" daemon prio=1 tid=0x25 nid=NA sleeping
  java.lang.Thread.State: TIMED_WAITING
   at java.lang.Thread.sleep(Thread.java:-1)
   at com.intellij.util.TimeoutUtil.sleep(TimeoutUtil.java:58)
   at com.intellij.openapi.vfs.impl.local.LocalFileSystemImpl$StoreRefreshStatusThread.run(LocalFileSystemImpl.java:355)

"ApplicationImpl pooled thread 3@3190" prio=4 tid=0x24 nid=NA sleeping
  java.lang.Thread.State: TIMED_WAITING
   at java.lang.Thread.sleep(Thread.java:-1)
   at com.intellij.util.TimeoutUtil.sleep(TimeoutUtil.java:58)
   at com.intellij.util.io.BaseDataReader.doRun(BaseDataReader.java:105)
   at com.intellij.util.io.BaseDataReader$1.run(BaseDataReader.java:46)
   at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:406)
   at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
   at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
   at java.util.concurrent.FutureTask.run(FutureTask.java:138)
   at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
   at java.lang.Thread.run(Thread.java:619)
   at org.jetbrains.ide.PooledThreadExecutor$1$1.run(PooledThreadExecutor.java:56)

"ApplicationImpl pooled thread 2@3177" prio=4 tid=0x23 nid=NA sleeping
  java.lang.Thread.State: TIMED_WAITING
   at java.lang.Thread.sleep(Thread.java:-1)
   at com.intellij.util.TimeoutUtil.sleep(TimeoutUtil.java:58)
   at com.intellij.util.io.BaseDataReader.doRun(BaseDataReader.java:105)
   at com.intellij.util.io.BaseDataReader$1.run(BaseDataReader.java:46)
   at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:406)
   at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
   at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
   at java.util.concurrent.FutureTask.run(FutureTask.java:138)
   at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
   at java.lang.Thread.run(Thread.java:619)
   at org.jetbrains.ide.PooledThreadExecutor$1$1.run(PooledThreadExecutor.java:56)

"Timer-1@12306" daemon prio=5 tid=0x3c nid=NA waiting
  java.lang.Thread.State: WAITING
   at java.lang.Object.wait(Object.java:-1)
   at java.util.TimerThread.mainLoop(Timer.java:509)
   at java.util.TimerThread.run(Timer.java:462)

"Timer-0@9338" daemon prio=6 tid=0x33 nid=NA waiting
  java.lang.Thread.State: WAITING
   at java.lang.Object.wait(Object.java:-1)
   at java.util.TimerThread.mainLoop(Timer.java:509)
   at java.util.TimerThread.run(Timer.java:462)

"timer-int@6250" daemon prio=6 tid=0x30 nid=NA waiting
  java.lang.Thread.State: WAITING
   at java.lang.Object.wait(Object.java:-1)
   at java.util.TimerThread.mainLoop(Timer.java:509)
   at java.util.TimerThread.run(Timer.java:462)

"TimerQueue@6158" daemon prio=5 tid=0x2f nid=NA waiting
  java.lang.Thread.State: WAITING
   at java.lang.Object.wait(Object.java:-1)
   at javax.swing.TimerQueue.run(TimerQueue.java:232)
   at java.lang.Thread.run(Thread.java:619)

"FocusManager timer@4229" daemon prio=2 tid=0x29 nid=NA waiting
  java.lang.Thread.State: WAITING
   at java.lang.Object.wait(Object.java:-1)
   at java.lang.Object.wait(Object.java:485)
   at java.util.TimerThread.mainLoop(Timer.java:483)
   at java.util.TimerThread.run(Timer.java:462)

"Shared SimpleTimer@4227" daemon prio=2 tid=0x28 nid=NA waiting
  java.lang.Thread.State: WAITING
   at java.lang.Object.wait(Object.java:-1)
   at java.util.TimerThread.mainLoop(Timer.java:509)
   at java.util.TimerThread.run(Timer.java:462)

"AWT-Shutdown@1870" prio=6 tid=0x16 nid=NA waiting
  java.lang.Thread.State: WAITING
   at java.lang.Object.wait(Object.java:-1)
   at java.lang.Object.wait(Object.java:485)
   at sun.awt.AWTAutoShutdown.run(AWTAutoShutdown.java:265)
   at java.lang.Thread.run(Thread.java:619)

"AWT-Windows@892" daemon prio=6 tid=0xf nid=NA runnable
  java.lang.Thread.State: RUNNABLE
   at sun.awt.windows.WToolkit.eventLoop(WToolkit.java:-1)
   at sun.awt.windows.WToolkit.run(WToolkit.java:295)
   at java.lang.Thread.run(Thread.java:619)

"Java2D Disposer@888" daemon prio=10 tid=0xd nid=NA waiting
  java.lang.Thread.State: WAITING
   at java.lang.Object.wait(Object.java:-1)
   at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:118)
   at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:134)
   at sun.java2d.Disposer.run(Disposer.java:125)
   at java.lang.Thread.run(Thread.java:619)

"Finalizer@18544" daemon prio=8 tid=0x3 nid=NA waiting
  java.lang.Thread.State: WAITING
   at java.lang.Object.wait(Object.java:-1)
   at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:118)
   at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:134)
   at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)

"Reference Handler@18545" daemon prio=10 tid=0x2 nid=NA waiting
  java.lang.Thread.State: WAITING
   at java.lang.Object.wait(Object.java:-1)
   at java.lang.Object.wait(Object.java:485)
   at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:116)

"DestroyJavaVM@1209" prio=5 tid=0x12 nid=NA runnable
  java.lang.Thread.State: RUNNABLE

"Attach Listener@18542" daemon prio=5 tid=0x5 nid=NA runnable
  java.lang.Thread.State: RUNNABLE

"Signal Dispatcher@18543" daemon prio=9 tid=0x4 nid=NA runnable
  java.lang.Thread.State: RUNNABLE

0
Comment actions Permalink

Excuse me, was not paying enough attention.

0
Comment actions Permalink

I am using the fillCompletionVariants method to implement the CompletionContributor and the contributor extends the DefaultCompletionContributor. I checked more of the implementation but I don't see a reason why the completion would freeze entire intellij if the completion contributor is working async. Have you got a clue?

0

Please sign in to leave a comment.