basgren / railways

A plugin for RubyMine and IntelliJ IDEA Ultimate that adds a panel with routes of Ruby on Rails application.
MIT License
46 stars 18 forks source link

Exception in Plugin Railways #27

Closed adam-phillips closed 7 years ago

adam-phillips commented 7 years ago

I haven't updated Railways, and have never had a problem with the plugin. In fact, it's become a pretty integral part of my workflow. A couple of weeks ago I started seeing an IDE Fatal Error related to Railways. RubyMine does technically still function, as does the plugin, but at a snails pace rendering it unusable. As soon as I deactivate the plugin, all's well. Here's the stacktrace for the error:

Write access is allowed from write-safe contexts only. Please ensure you're using invokeLater/invokeAndWait with a correct modality state (not "any"). See TransactionGuard documentation for details. current modality=ModalityState:Loading Project 1320988162: running=true; canceled=false known modalities={ModalityState.NON_MODAL=true, ModalityState:Loading Project 1828521477: running=false; canceled=false=true, ModalityState:Loading Project 1320988162: running=true; canceled=false=true} java.lang.Throwable at com.intellij.openapi.diagnostic.Logger.error(Logger.java:132) at com.intellij.openapi.application.TransactionGuardImpl.assertWriteActionAllowed(TransactionGuardImpl.java:235) at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.saveAllDocuments(FileDocumentManagerImpl.java:298) at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.saveAllDocuments(FileDocumentManagerImpl.java:290) at net.bitpot.railways.routesView.RoutesManager.updateRouteList(Unknown Source) at net.bitpot.railways.routesView.RoutesManager.initRouteList(Unknown Source) at net.bitpot.railways.routesView.RoutesViewPane.<init>(Unknown Source) at net.bitpot.railways.routesView.RoutesView.addModulePane(Unknown Source) at net.bitpot.railways.routesView.RoutesView.initToolWindow(Unknown Source) at net.bitpot.railways.routesView.RoutesViewToolWindowFactory.createToolWindowContent(Unknown Source) at com.intellij.openapi.wm.impl.ToolWindowImpl.ensureContentInitialized(ToolWindowImpl.java:568) at com.intellij.openapi.wm.impl.ToolWindowManagerImpl.a(ToolWindowManagerImpl.java:488) at com.intellij.openapi.wm.impl.ToolWindowManagerImpl.initToolWindow(ToolWindowManagerImpl.java:491) at com.intellij.openapi.wm.impl.ToolWindowManagerImpl$4.run(ToolWindowManagerImpl.java:448) at com.intellij.openapi.wm.impl.CommandProcessor.a(CommandProcessor.java:92) at com.intellij.openapi.wm.impl.CommandProcessor.run(CommandProcessor.java:72) at com.intellij.openapi.wm.impl.commands.FinalizableCommand.finish(FinalizableCommand.java:36) at com.intellij.openapi.wm.impl.ToolWindowsPane$AddToolStripeButtonCmd.run(ToolWindowsPane.java:993) at com.intellij.openapi.wm.impl.CommandProcessor.a(CommandProcessor.java:92) at com.intellij.openapi.wm.impl.CommandProcessor.run(CommandProcessor.java:72) at com.intellij.openapi.wm.impl.commands.FinalizableCommand.finish(FinalizableCommand.java:36) at com.intellij.openapi.wm.impl.ToolWindowsPane$AddToolStripeButtonCmd.run(ToolWindowsPane.java:993) at com.intellij.openapi.wm.impl.CommandProcessor.a(CommandProcessor.java:92) at com.intellij.openapi.wm.impl.CommandProcessor.run(CommandProcessor.java:72) at com.intellij.openapi.wm.impl.commands.FinalizableCommand.finish(FinalizableCommand.java:36) at com.intellij.openapi.wm.impl.ToolWindowsPane$AddToolStripeButtonCmd.run(ToolWindowsPane.java:993) at com.intellij.openapi.wm.impl.CommandProcessor.a(CommandProcessor.java:92) at com.intellij.openapi.wm.impl.CommandProcessor.run(CommandProcessor.java:72) at com.intellij.openapi.wm.impl.CommandProcessor.flush(CommandProcessor.java:46) at com.intellij.openapi.wm.impl.ToolWindowManagerImpl.l(ToolWindowManagerImpl.java:570) at com.intellij.openapi.wm.impl.ToolWindowManagerImpl.access$3500(ToolWindowManagerImpl.java:90) at com.intellij.openapi.wm.impl.ToolWindowManagerImpl$InitToolWindowsActivity.a(ToolWindowManagerImpl.java:2491) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:762) at java.awt.EventQueue.access$500(EventQueue.java:98) at java.awt.EventQueue$3.run(EventQueue.java:715) at java.awt.EventQueue$3.run(EventQueue.java:709) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80) at java.awt.EventQueue.dispatchEvent(EventQueue.java:732) at com.intellij.ide.IdeEventQueue.e(IdeEventQueue.java:827) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:655) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:365) at com.intellij.ide.IdeEventQueue.pumpEventsForHierarchy(IdeEventQueue.java:923) at com.intellij.openapi.progress.util.ProgressWindow.startBlocking(ProgressWindow.java:199) at com.intellij.openapi.progress.util.ProgressWindow.startBlocking(ProgressWindow.java:186) at com.intellij.openapi.application.impl.ApplicationImpl.runProcessWithProgressSynchronously(ApplicationImpl.java:608) at com.intellij.openapi.progress.impl.CoreProgressManager.runProcessWithProgressSynchronously(CoreProgressManager.java:422) at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcessWithProgressSynchronously(ProgressManagerImpl.java:89) at com.intellij.openapi.progress.impl.CoreProgressManager.runProcessWithProgressSynchronously(CoreProgressManager.java:270) at com.intellij.openapi.progress.impl.CoreProgressManager.runProcessWithProgressSynchronously(CoreProgressManager.java:222) at com.intellij.openapi.project.impl.ProjectManagerImpl.openProject(ProjectManagerImpl.java:387) at com.intellij.platform.PlatformProjectOpenProcessor.doOpenProject(PlatformProjectOpenProcessor.java:254) at com.intellij.ide.RecentDirectoryProjectsManager.doOpenProject(RecentDirectoryProjectsManager.java:59) at com.intellij.ide.RecentProjectsManagerBase.doReopenLastProject(RecentProjectsManagerBase.java:619) at com.intellij.ide.RecentProjectsManagerBase$MyAppLifecycleListener.appStarting(RecentProjectsManagerBase.java:661) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.intellij.util.messages.impl.MessageBusConnectionImpl.deliverMessage(MessageBusConnectionImpl.java:117) at com.intellij.util.messages.impl.MessageBusImpl.doPumpMessages(MessageBusImpl.java:437) at com.intellij.util.messages.impl.MessageBusImpl.pumpWaitingBuses(MessageBusImpl.java:398) at com.intellij.util.messages.impl.MessageBusImpl.pumpMessages(MessageBusImpl.java:387) at com.intellij.util.messages.impl.MessageBusImpl.sendMessage(MessageBusImpl.java:373) at com.intellij.util.messages.impl.MessageBusImpl.access$200(MessageBusImpl.java:44) at com.intellij.util.messages.impl.MessageBusImpl$2.invoke(MessageBusImpl.java:230) at com.sun.proxy.$Proxy55.appStarting(Unknown Source) at com.intellij.idea.IdeaApplication$IdeStarter.a(IdeaApplication.java:350) at com.intellij.openapi.application.TransactionGuardImpl.a(TransactionGuardImpl.java:86) at com.intellij.openapi.application.TransactionGuardImpl.a(TransactionGuardImpl.java:109) at com.intellij.openapi.application.TransactionGuardImpl.submitTransaction(TransactionGuardImpl.java:118) at com.intellij.openapi.application.TransactionGuard.submitTransaction(TransactionGuard.java:122) at com.intellij.idea.IdeaApplication$IdeStarter.main(IdeaApplication.java:348) at com.intellij.idea.IdeaApplication.b(IdeaApplication.java:202) at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:193) at com.intellij.idea.IdeaApplication.run(IdeaApplication.java:202) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.intellij.idea.MainImpl$1$1.a(MainImpl.java:65) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:762) at java.awt.EventQueue.access$500(EventQueue.java:98) at java.awt.EventQueue$3.run(EventQueue.java:715) at java.awt.EventQueue$3.run(EventQueue.java:709) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80) at java.awt.EventQueue.dispatchEvent(EventQueue.java:732) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:343) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

Any ideas or plans for a fix I'm not aware of?

basgren commented 7 years ago

Thank you for such a detailed report! Could you please also tell me the exact version of your IDE including build number?

adam-phillips commented 7 years ago

@basgren Absolutely! I'm using (name, license info, etc redacted): RubyMine 2017.1 Build #RM-171.3780.96, built on March 20, 2017 JRE: 1.8.0_112-release-736-b13 x86_64 JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o Mac OS X 10.12.3


I was previously using the latest build of 2016.2, but working with JetBrains they had me update to 2017.1 RC before it was actually released, and I've since updated to the official release. So this actually began in 2016.2, where it had been working fine since I upgraded 2016.2.

JB originally told me, "Railways plugin uses incorrect way of model invalidation. The problem is located in https://github.com/basgren/railways/blob/master/src/net/bitpot/railways/routesView/RoutesView.java (subclasses PSIModificationListener and MyRoutesManagerListener). Probably we should make a pull request there and we'll try to do it in the nearest future."

I asked what had changed and provided a few CPU and memory snapshots, but haven't gotten any further.

Thank you so much for your quick response, and please let me know if I can provide more!

basgren commented 7 years ago

Wow! Thank you! You've dug even deeper than I expected!))) I need some time to investigate what's the correct way of model invalidation now, as in IDE versions prior to 2017.1 I didn't see any exceptions with the same code. Possibly some changes were introduced in IDE SDK. By the way, how did you communicate with JB? If you have created a ticket in YouTrack, could you please provide a link? If not... Well. Not a problem :)

adam-phillips commented 7 years ago

@basgren again - absolutely! What can I say, I love Railways :)

I don't believe I've done anything with Youtrack and everything's been through IDE support, but I may be misunderstanding the workflow. This is the first issue I've had in 3 years, so I'm not super familiar with their error tracking. I do have an open request number/id with JetBrains - 905797 and I've been working with Olga Kuvardina.

That ticket was opened on 3/20, but hasn't really seen any activity since 3/24. I wasn't seeing an IDE error before - it was just basically unusably slow. I'm not sure what they gleaned from my CPU/memory snapshots to point them towards where they thought the problem was. Hopefully you can see it and get some insight....

Thanks again for your responsiveness!

basgren commented 7 years ago

Thank you!) Will ping them if I don't find solution quickly. Unfortunately about a year I don't work with Ruby/Rails, so I don't track plugin compatibility with new IDE versions, but if you see something is wrong with it - feel free to report. I'm still supporting it in a background)

adam-phillips commented 7 years ago

You're the best - thank you so much! And please don't hesitate to ping me if there's anything else I can provide. You have no idea how much I appreciate your work on Railways!