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 123213 - Deadlock when closing web project in 6.0 FCS build
Summary: Deadlock when closing web project in 6.0 FCS build
Status: VERIFIED FIXED
Alias: None
Product: webservices
Classification: Unclassified
Component: REST (show other bugs)
Version: 6.x
Hardware: All Linux
: P2 blocker (vote)
Assignee: Nam Nguyen
URL:
Keywords: THREAD
Depends on:
Blocks:
 
Reported: 2007-12-02 11:25 UTC by Roman Strobl
Modified: 2008-03-22 23:01 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Thread dump (37.74 KB, text/plain)
2007-12-02 11:26 UTC, Roman Strobl
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Roman Strobl 2007-12-02 11:25:19 UTC
Deadlock occurred when I was closing a web project in FCS build of NetBeans 6.0.

Thread dump attached. Problematic threads are:

"AWT-EventQueue-1":
  waiting for ownable synchronizer 0x730a9b18, (a java.util.concurrent.locks.ReentrantLock$FairSync),
  which is held by "PersistentObjectManager"
"PersistentObjectManager":
  waiting to lock monitor 0x080847e0 (object 0x72e52a08, a org.netbeans.modules.project.ui.OpenProjectList),
  which is held by "AWT-EventQueue-1"

System info:
Product Version: NetBeans IDE 6.0 (Build 200711261600)
Java: 1.6.0_03; Java HotSpot(TM) Client VM 1.6.0_03-b05
System: Linux version 2.6.22-14-generic running on i386; UTF-8; en_US (nb)
Comment 1 Roman Strobl 2007-12-02 11:26:16 UTC
Created attachment 53754 [details]
Thread dump
Comment 2 Andrei Badea 2007-12-03 12:38:45 UTC
The main culprit is websvc/rest, which modifies the project in a metadata model action without any good reason. It
should call the RestUtil methods in WebRestSupportLookupProvider$RestServicesChangeListener.updateRestServices() outside
the action.

Actually, when I look at WebRestSupportLookupProvider, there is another problem with it. In a project with no REST web
services it will likely modify and save the project whenever the classpath changes (which will make the model send a
change event). It would be good if you tested if the project has (or does not have) the REST libraries on the classpath
before modifying it.
Comment 3 Nam Nguyen 2007-12-04 15:39:20 UTC
Fixed in trunk.
1. only model read need to happen in runReadAction.
2. checking if rest support is on/off to avoid unecessary project save

/cvs/websvc/rest/src/org/netbeans/modules/websvc/rest/RestUtils.java,v  <--  RestUtils.java
new revision: 1.21; previous revision: 1.20
/cvs/websvc/rest/src/org/netbeans/modules/websvc/rest/RestUtils.java,v  <--  RestUtils.java
new revision: 1.22; previous revision: 1.21
/cvs/websvc/rest/src/org/netbeans/modules/websvc/rest/projects/WebRestSupportLookupProvider.java,v  <-- 
WebRestSupportLookupProvider.java
new revision: 1.18; previous revision: 1.17
Comment 4 Lukas Jungmann 2008-01-20 23:25:50 UTC
Roman, can you verify this, please? Thanks.
Comment 5 Lukas Jungmann 2008-03-22 23:01:22 UTC
v.