This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 249950 - Calls to ProjectManager.findProject in EDT causes long UI freeze
Summary: Calls to ProjectManager.findProject in EDT causes long UI freeze
Status: RESOLVED WONTFIX
Alias: None
Product: projects
Classification: Unclassified
Component: Generic Infrastructure (show other bugs)
Version: 8.1
Hardware: All All
: P1 normal (vote)
Assignee: Tomas Stupka
URL:
Keywords:
Depends on: 172061
Blocks:
  Show dependency tree
 
Reported: 2015-01-22 13:01 UTC by Vladimir Kvashin
Modified: 2015-07-15 12:18 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 153970


Attachments
Message log (the start of it - the rest is flooded by my own trace output) (40.95 KB, text/plain)
2015-01-22 13:38 UTC, Vladimir Kvashin
Details
Possible fix (6.73 KB, patch)
2015-05-14 07:56 UTC, Vladimir Kvashin
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Kvashin 2015-01-22 13:01:59 UTC
I wasn't able to create a slowness report since this was in debug mode.
When a long UI freeze occurred, I just got thread dump and found that ProjectManager.findProject in called in EDT.

NavigatorContent.java:314 calls navigate(dobj) via SwingUtilities.invokeLater, which I guess leads to this problem.

The stack is:

"AWT-EventQueue-0" prio=10 tid=0x00007f5e54164000 nid=0x1a1 in Object.wait() [0x00007f5e70273000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	- waiting on <0x00000000eab04af8> (a org.netbeans.modules.openide.util.DefaultMutexImplementation$QueueCell)
	at org.netbeans.modules.openide.util.DefaultMutexImplementation$QueueCell.sleep(DefaultMutexImplementation.java:1229)
	- locked <0x00000000eab04af8> (a org.netbeans.modules.openide.util.DefaultMutexImplementation$QueueCell)
	at org.netbeans.modules.openide.util.DefaultMutexImplementation.enterImpl(DefaultMutexImplementation.java:498)
	at org.netbeans.modules.openide.util.DefaultMutexImplementation.enter(DefaultMutexImplementation.java:405)
	at org.netbeans.modules.openide.util.DefaultMutexImplementation.readEnter(DefaultMutexImplementation.java:388)
	at org.netbeans.modules.openide.util.DefaultMutexImplementation.readAccess(DefaultMutexImplementation.java:249)
	at org.openide.util.Mutex.readAccess(Mutex.java:250)
	at org.netbeans.modules.projectapi.nb.NbProjectManager.findProject(NbProjectManager.java:243)
	at org.netbeans.api.project.ProjectManager.findProject(ProjectManager.java:164)
	at org.netbeans.modules.projectapi.SimpleFileOwnerQueryImplementation.getOwner(SimpleFileOwnerQueryImplementation.java:144)
	at org.netbeans.api.project.FileOwnerQuery.getOwner(FileOwnerQuery.java:114)
	at org.netbeans.modules.projectapi.ProjectFileEncodingQueryImplementation.getEncoding(ProjectFileEncodingQueryImplementation.java:66)
	at org.netbeans.api.queries.FileEncodingQuery.getEncoding(FileEncodingQuery.java:96)
	at org.openide.text.DataEditorSupport.openDocument(DataEditorSupport.java:583)
	at org.netbeans.modules.xml.text.navigator.NavigatorContent.navigate(NavigatorContent.java:134)
	at org.netbeans.modules.xml.text.navigator.NavigatorContent$3.run(NavigatorContent.java:314)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:312)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733)
	at java.awt.EventQueue.access$200(EventQueue.java:103)
	at java.awt.EventQueue$3.run(EventQueue.java:694)
	at java.awt.EventQueue$3.run(EventQueue.java:692)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:703)
	at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:159)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:154)
	at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:182)
	at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:221)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:219)
	at java.awt.Dialog.show(Dialog.java:1082)
	at javax.swing.JFileChooser.showDialog(JFileChooser.java:741)
	at javax.swing.JFileChooser.showOpenDialog(JFileChooser.java:639)
	at org.netbeans.modules.project.ui.actions.OpenProject.show(OpenProject.java:130)
	at org.netbeans.modules.project.ui.actions.OpenProject.actionPerformed(OpenProject.java:103)
	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
	at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
	at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
	at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
	at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
	at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:290)
	at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)
	at java.awt.Component.processMouseEvent(Component.java:6516)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3320)
	at java.awt.Component.processEvent(Component.java:6281)
	at java.awt.Container.processEvent(Container.java:2229)
	at java.awt.Component.dispatchEventImpl(Component.java:4872)
	at java.awt.Container.dispatchEventImpl(Container.java:2287)
	at java.awt.Component.dispatchEvent(Component.java:4698)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
	at java.awt.Container.dispatchEventImpl(Container.java:2273)
	at java.awt.Window.dispatchEventImpl(Window.java:2719)
	at java.awt.Component.dispatchEvent(Component.java:4698)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:735)
	at java.awt.EventQueue.access$200(EventQueue.java:103)
	at java.awt.EventQueue$3.run(EventQueue.java:694)
	at java.awt.EventQueue$3.run(EventQueue.java:692)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
	at java.awt.EventQueue$4.run(EventQueue.java:708)
	at java.awt.EventQueue$4.run(EventQueue.java:706)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:705)
	at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:159)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
Comment 1 Vladimir Kvashin 2015-01-22 13:03:50 UTC
For CND and Oracle Solaris Studio products that are based on NetBeans
this is quite serious. They support remote development, where file system is sometimes really slow.
Comment 2 Vladimir Kvashin 2015-01-22 13:38:59 UTC
Created attachment 151619 [details]
Message log (the start of it - the rest is flooded by my own trace output)
Comment 3 Svata Dedic 2015-05-04 14:46:30 UTC

*** This bug has been marked as a duplicate of bug 172061 ***
Comment 4 Svata Dedic 2015-05-05 08:43:15 UTC
Incorrectly duplicated, although XML navigator should NOT work in EDT (see issue #172061), it's necessary to fix/avoid contention on findProject, which causes most of the reports.

> 200 duplicates, making P1.
Comment 5 Vladimir Kvashin 2015-05-14 07:56:59 UTC
Created attachment 153649 [details]
Possible fix

I proposed the following fix; after discussion with Alexander Simon we decided to post tasks in each client instead; however I better attach this fix here in case we'll return to it for some reason
Comment 6 Vladimir Kvashin 2015-05-14 09:54:24 UTC
(In reply to Vladimir Kvashin from comment #5)
> Created attachment 153649 [details]
> Possible fix
Please disregard this comment and attachment as it was related to a different issue. Sorry.
Comment 7 Tomas Stupka 2015-07-15 12:18:43 UTC
unfortunately, there is no way around contention on findProject while projects are being opened

reassigned reports since 8.0 to the particular project owners, closing this one