jshiell / checkstyle-idea

CheckStyle plug-in for IntelliJ IDEA
https://plugins.jetbrains.com/plugin/1065-checkstyle-idea
Other
889 stars 161 forks source link

IDE internal error: VirtualFileUrlManagerImpl.fromUrl #612

Closed thomas-k-git closed 1 year ago

thomas-k-git commented 1 year ago

Not sure what cause it / how to reproduce it.

Context where it occurred:

Having multiple IntelliJ windows open with projects where checkstyle is active. One window was debugging with two processes running (one in debug and one in "run" ). was clicking terminate for both and then killing the one in debug mode while it was terminating. Then saw this popup.

IntelliJ IDEA 2023.1.1 (Ultimate Edition) Build #IU-231.8770.65, built on April 27, 2023 Subscription is active until October 31, 2023. Runtime version: 17.0.6+10-b829.9 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. Linux 6.2.0-20-generic GC: G1 Young Generation, G1 Old Generation Memory: 20480M Cores: 16 Registry: compiler.ref.index=false

Non-Bundled Plugins: UNDISCLOSED (0.5.5) jclasslib (6.0.4.2) CheckStyle-IDEA (5.79.0) org.exbin.deltahex.intellij (0.2.7) org.sonarlint.idea (8.2.0.68615) com.rookout.intellij-plugin (2.0.12)

Kotlin: 231-1.8.21-IJ8770.65 Current Desktop: ubuntu:GNOME

com.intellij.diagnostic.PluginException: 390 ms to call on EDT ScanModule#update@CheckStyle (org.infernus.idea.checkstyle.actions.ScanModule). Revise AnAction.getActionUpdateThread property [Plugin: CheckStyle-IDEA] at com.intellij.diagnostic.PluginProblemReporterImpl.createPluginExceptionByClass(PluginProblemReporterImpl.java:23) at com.intellij.diagnostic.PluginException.createByClass(PluginException.java:89) at com.intellij.openapi.actionSystem.impl.ActionUpdater.computeOnEdt(ActionUpdater.java:255) at com.intellij.openapi.actionSystem.impl.ActionUpdater.callAction(ActionUpdater.java:206) .... at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699) at java.base/java.lang.Thread.run(Thread.java:833) Suppressed: java.lang.Throwable: EDT-trace-at-309-ms (5/5) at com.intellij.workspaceModel.storage.impl.url.VirtualFileUrlManagerImpl.fromUrl(VirtualFileUrlManagerImpl.kt) at com.intellij.workspaceModel.core.fileIndex.impl.NonIncrementalContributors.computeCustomExcludedRoots(NonIncrementalContributors.kt:134) at com.intellij.workspaceModel.core.fileIndex.impl.NonIncrementalContributors.updateIfNeeded(NonIncrementalContributors.kt:48) at com.intellij.workspaceModel.core.fileIndex.impl.WorkspaceFileIndexDataImpl.ensureIsUpToDate(WorkspaceFileIndexDataImpl.kt:128) at com.intellij.workspaceModel.core.fileIndex.impl.WorkspaceFileIndexDataImpl.getFileInfo(WorkspaceFileIndexDataImpl.kt:70) at com.intellij.workspaceModel.core.fileIndex.impl.WorkspaceFileIndexImpl.getFileInfo(WorkspaceFileIndexImpl.kt:220) ... at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207) at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128) at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105) at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)

See full stack trace attached (exceeds max text here)

thomas-k-git commented 1 year ago

pluginEx.log

jshiell commented 1 year ago

Thanks very much - this looks like it's related to the perf work in the IDEA core, where it's now getting a lot more aggressive about the time taking to execute by certan actions. In particular, this means any FS access needs to be removed, or at the least moved to a worker thread, in order to be safe. I've already fixed a few instances of this, so it doesn't surprise me at all that there are more to done.

The good news for the meantime is that it's just annoying, not harmful.

thomas-k-git commented 1 year ago

As always, thanks for looking into it Jamie!

jshiell commented 1 year ago

This looks like the FS access in the ScanModule#update function can sometimes exceed the limit. I'll drop it, and rely on the check in the actionPerformed method (which is JetBrains' recommended solution).

jshiell commented 1 year ago

Fixed in 5.80.1