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 172525

Summary: AWT thread blocked for a long time when switching project configuration
Product: projects Reporter: Exceptions Reporter <exceptions_reporter>
Component: MavenAssignee: Antonin Nebuzelsky <anebuzelsky>
Status: RESOLVED FIXED    
Severity: blocker CC: jglick
Priority: P3 Keywords: PERFORMANCE
Version: 6.x   
Hardware: All   
OS: All   
URL: http://statistics.netbeans.org/exceptions/detail.do?id=158713
Issue Type: DEFECT Exception Reporter: 158713
Attachments: nps snapshot
nps snapshot

Description Exceptions Reporter 2009-09-17 21:10:33 UTC
Build: NetBeans IDE Dev (Build nbms-and-javadoc-3942-on-090917)
VM: Java HotSpot(TM) Client VM, 14.2-b01, Java(TM) SE Runtime Environment, 1.6.0_16-b01
OS: Windows XP, 5.2, x86
Maximum slowness yet reported was 96265 ms, average is 96265
Comment 1 Exceptions Reporter 2009-09-17 21:10:39 UTC
Created attachment 87887 [details]
nps snapshot
Comment 2 Milan Kubec 2009-09-18 07:27:32 UTC
Time in AWT is spent during saving Maven configuration. Please evaluate.
Comment 3 Exceptions Reporter 2010-01-07 02:23:27 UTC
Created attachment 93110 [details]
nps snapshot

changed project configuration
Comment 4 Antonin Nebuzelsky 2010-07-30 15:17:30 UTC
Reassigning to default owner.
Comment 5 Antonin Nebuzelsky 2010-09-23 12:49:26 UTC
The method ActiveConfigAction.setActiveConfiguration() needs to acquire the mutex on projects to be able to proceed.

In the report from 2009-09-17 the AWT thread is waiting on a mutex for maven's DependencyNode spending time in separate thread in MavenFileOwnerQueryImpl's expensive cache preparation. Similar dependency of the AWT thread on finishing MavenFileOwnerQueryImpl's expensive cache preparation is in the reports from 2010-03-18 and 2010-04-06 where it is triggered in one of the parsing and indexing threads. These three occurrences of the problem should be eliminated in 6.10 by the fix of issue 186024.

In the report from 2010-01-07 the AWT thread is waiting on a mutex for Load Open Projects thread to finish loading projects. The report from 2010-05-21 shows that system is completely overloaded by the many builds running at the same time. Refresh of recent project list which acquired the project mutex is hanging for >15s in a java.io.WinNTFileSystem call.

These last two cases could be eliminated only by scheduling the code in ActiveConfigAction.setActiveConfiguration() (or in actionPerformed methods in ActiveConfigAction) out of AWT thread into a separate thread where waiting for the project mutex would do no harm to UI responsiveness.

Jesse, is this last suggestion possible?
Comment 6 Jesse Glick 2010-09-23 12:56:47 UTC
(In reply to comment #5)
> scheduling the code in
> ActiveConfigAction.setActiveConfiguration() (or in actionPerformed methods in
> ActiveConfigAction) out of AWT thread into a separate thread

Probably would be OK. See also asynch refresh: bug #175348
Comment 7 Antonin Nebuzelsky 2010-09-24 09:28:30 UTC
core-main #86280e21d9a9
Comment 8 Quality Engineering 2010-09-25 02:54:40 UTC
Integrated into 'main-golden', will be available in build *201009250000* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/86280e21d9a9
User: Antonin Nebuzelsky <anebuzelsky@netbeans.org>
Log: #172525 - AWT thread blocked for a long time when switching project configuration.