defrac / defrac-plugin-intellij

defrac Plug-In for IntellJ IDEA
Apache License 2.0
5 stars 1 forks source link

Don't call synchronous refresh under read lock #23

Open joa opened 9 years ago

joa commented 9 years ago

The DefracRunConfigurationProducer updates the configuration, which also explains users reporting their main getting changed by the IDE plug-in. It does this while holding the read-lock but instead should do this when protected by the write-lock.

Do not call synchronous refresh under read lock (except from EDT) - this will cause a deadlock if there are any events to fire.
java.lang.Throwable
    at com.intellij.openapi.diagnostic.Logger.error(Logger.java:115)
    at com.intellij.openapi.vfs.newvfs.RefreshQueueImpl.execute(RefreshQueueImpl.java:62)
    at com.intellij.openapi.vfs.newvfs.RefreshSessionImpl.launch(RefreshSessionImpl.java:120)
    at com.intellij.openapi.vfs.newvfs.RefreshQueue.refresh(RefreshQueue.java:68)
    at com.intellij.openapi.vfs.newvfs.RefreshQueue.refresh(RefreshQueue.java:48)
    at com.intellij.openapi.vfs.impl.local.LocalFileSystemBase.refreshIoFiles(LocalFileSystemBase.java:256)
    at com.intellij.openapi.vfs.impl.local.LocalFileSystemBase.refreshIoFiles(LocalFileSystemBase.java:235)
    at defrac.intellij.config.DefracConfig.commit(DefracConfig.java:177)
    at defrac.intellij.run.DefracRunConfigurationProducer.updateConfig(DefracRunConfigurationProducer.java:103)
    at defrac.intellij.run.DefracRunConfigurationProducer.setupConfigurationFromContext(DefracRunConfigurationProducer.java:68)
    at defrac.intellij.run.DefracRunConfigurationProducer.setupConfigurationFromContext(DefracRunConfigurationProducer.java:46)
    at com.intellij.execution.actions.RunConfigurationProducer.createLightConfiguration(RunConfigurationProducer.java:251)
    at com.intellij.execution.lineMarker.ExecutorAction.createConfiguration(ExecutorAction.java:95)
    at com.intellij.execution.lineMarker.ExecutorAction.access$100(ExecutorAction.java:39)
    at com.intellij.execution.lineMarker.ExecutorAction$2.fun(ExecutorAction.java:82)
    at com.intellij.execution.lineMarker.ExecutorAction$2.fun(ExecutorAction.java:79)
    at com.intellij.util.containers.ContainerUtil.mapNotNull(ContainerUtil.java:1833)
    at com.intellij.execution.lineMarker.ExecutorAction.getActionName(ExecutorAction.java:78)
    at com.intellij.execution.lineMarker.ExecutorAction.update(ExecutorAction.java:65)
    at com.intellij.execution.lineMarker.LineMarkerActionWrapper.update(LineMarkerActionWrapper.java:46)
    at com.intellij.codeInsight.daemon.impl.GutterIntentionAction.isAvailable(GutterIntentionAction.java:71)
    at com.intellij.codeInsight.daemon.impl.GutterIntentionAction.addActions(GutterIntentionAction.java:137)
    at com.intellij.codeInsight.daemon.impl.GutterIntentionAction.addActions(GutterIntentionAction.java:130)
    at com.intellij.codeInsight.daemon.impl.GutterIntentionAction.addActions(GutterIntentionAction.java:98)
    at com.intellij.codeInsight.daemon.impl.ShowIntentionsPass$4.process(ShowIntentionsPass.java:324)
    at com.intellij.codeInsight.daemon.impl.ShowIntentionsPass$4.process(ShowIntentionsPass.java:321)
    at com.intellij.openapi.editor.impl.MarkupModelImpl.processRangeHighlightersOverlappingWith(MarkupModelImpl.java:265)
    at com.intellij.codeInsight.daemon.impl.ShowIntentionsPass.getActionsToShow(ShowIntentionsPass.java:320)
    at com.intellij.codeInsight.daemon.impl.ShowIntentionsPass.getIntentionActionsToShow(ShowIntentionsPass.java:221)
    at com.intellij.codeInsight.daemon.impl.ShowIntentionsPass.doCollectInformation(ShowIntentionsPass.java:197)
    at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:67)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass$1$1.run(PassExecutorService.java:444)
    at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1155)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass$1.run(PassExecutorService.java:435)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:446)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:392)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.doRun(PassExecutorService.java:432)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:408)
    at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:206)
    at jsr166e.ForkJoinTask.doExec(ForkJoinTask.java:260)
    at jsr166e.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:858)
    at jsr166e.ForkJoinPool.scan(ForkJoinPool.java:1687)
    at jsr166e.ForkJoinPool.runWorker(ForkJoinPool.java:1642)
    at jsr166e.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:108)