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 223714 - Shutdown blocked in AWT for 5 seconds
Summary: Shutdown blocked in AWT for 5 seconds
Status: VERIFIED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Module System (show other bugs)
Version: 7.3
Hardware: All All
: P2 normal (vote)
Assignee: Jaroslav Tulach
URL:
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2012-12-12 10:51 UTC by Jiri Skrivanek
Modified: 2012-12-17 13:24 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Nb Exit and AWT threads before 5 second lock. (2.75 KB, text/plain)
2012-12-12 10:51 UTC, Jiri Skrivanek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Skrivanek 2012-12-12 10:51:30 UTC
Created attachment 129257 [details]
Nb Exit and AWT threads before 5 second lock.

When NbLifecycleManager.exit() is called from AWT thread then it always waits for 5 seconds in AWT in finishExitState method because of 

if (cdl[0].await(5, TimeUnit.SECONDS)) {

CountDownLatch cannot be released because at the same time NbLifeExit.run(NbLifeExit.java:110) delegates further execution to AWT thread and it has to wait until cdl[0].await() finishes.
I tried to remove waiting. It works. I don't know if it is harmless change but definitely it saves couple second on shutdown.

It was discovered while verifying bug 223300. Steps are as follows:
- create java project
- modify Main.java
- close IDE
- click Cancel button in Unsaved files dialog
- you can notice several seconds delay when IDE is unresponsive

Product Version: NetBeans IDE Dev (Build 201212120001)
Java: 1.7.0_10; Java HotSpot(TM) 64-Bit Server VM 23.6-b04
Runtime: Java(TM) SE Runtime Environment 1.7.0_10-b18
System: Windows 7 version 6.1 running on amd64; Cp1250; en_US (nb)
Comment 1 Jaroslav Tulach 2012-12-13 15:01:47 UTC
ergonomics#e5d7c9bcbe7c
Comment 2 Quality Engineering 2012-12-17 12:38:29 UTC
Integrated into 'main-golden', will be available in build *201212170919* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/e5d7c9bcbe7c
User: Jaroslav Tulach <jtulach@netbeans.org>
Log: #223714: Remember early when exit is happening on EDT and in such case don't waste time waiting for the exit to finish => start second dispatch queue immediately.