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.
Created attachment 134354 [details] Thread dump. The IDE was locked while automated test was creating web service client in EJB EE6 project. So far I am not sure it is random or reproducible failure. Product Version = NetBeans IDE 7.3.1 (Build javaee7-301-on-20130510) (#5c7cb9e7d72c) Operating System = Windows 7 version 6.1 running on x86 Java; VM; Vendor = 1.7.0_21; Java HotSpot(TM) Client VM 23.21-b01; Oracle Corporation Runtime = Java(TM) SE Runtime Environment 1.7.0_21-b11
Created attachment 134355 [details] Thread dump from Windows XP. It seems to be reproducible at least in automated tests. Attached is another thread dump from Windows XP (stack traces almost the same).
The deadlock is between those two threads: "org.netbeans.spi.project.ui.support.NodeFactorySupport" thread holds openide.nodes lock and updates some children nodes which in turn calls EJB Project's EjbsNodeFactory which calls EJB Metadata model which in turn calls parsing.api.ParserManager.parseWhenScanFinished. "Editor Parsing Loop (javaee7-301-on-20130510)" thread is calling java.navigation.BreadCrumbsScanningTask which needs to access nodes which are locked. I've seen the exactly same deadlock very recently. It was BreadCrumbsScanningTask against some other code updating nodes. I was able to workaround that case but this one I'm not sure. It's an existing code which was written this way for years. I wonder whether it could be solved on BreadCrumbsScanningTask side by doing nodes access outside of "Editor Parsing Loop" thread? What do you think Honza?
Assigning to lahvac as author of BreadCrumbsScanningTask.
Hm, I guess it is time to call off the experiment to convert the Java AST directly into the Nodes, and use an intermediate representation: http://hg.netbeans.org/jet-main/rev/637e74096694
Is the patch applicable for NB7.3.1? Somehow it should be fixed in 7.3.1.
(In reply to comment #5) > Is the patch applicable for NB7.3.1? Somehow it should be fixed in 7.3.1. Technically, I am able to backport it, as long as it can be verified and tested to both fix the problem and be safe.
If this change affects BreadCrumbs feature in general I am not able to cover all possible test cases. I can just verify the original Java EE test case and run tests. If you feel your change needs thorough testing, I prefer some isolated hotfix in 7.3.1.
(In reply to comment #7) > If this change affects BreadCrumbs feature in general I am not able to cover > all possible test cases. I can just verify the original Java EE test case and > run tests. If you feel your change needs thorough testing, I prefer some It surely needs good testing. > isolated hotfix in 7.3.1. Unfortunately, I don't see a safe fix in java.navigation. But suggestions on one are welcome.
The current deadlock is just one manifestation of a problem which can happen in many places. See issue 229415 which illustrates this problem with maven.jaxws.actions.AddOperationAction. So even if I somehow workaround this issue too it is likley the Breadcrumb will bite us somewhere else - most of EE modules are using the same pattern of calling metamodel which can result into parsing. Having said I can see that EjbContainerChildren is a bit too eager in attaching listener in its constructor - that could be postponed little bit and done in addNotify which may workaround this deadlock. I will try that.
I pushed alternative fix: e40617d963be That should fix the problem on the EJB module side. You may have to revert Honza's fix locally to test it. The fix is simple and should be save.
I built 7.3.1 with patch e40617d963be and tests passed without locking. I prefer to put just changeset e40617d963be into release73.
Martin, could you review please http://hg.netbeans.org/web-main/rev/e40617d963be ? Thanks.
(In reply to comment #12) > Martin, could you review please > http://hg.netbeans.org/web-main/rev/e40617d963be ? Thanks. Sure. The patch seems to be ok.
BTW, thanks for the fix into EjbContainerChildren.
Integrated into 'main-golden', will be available in build *201305170640* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/e40617d963be User: David Konecny <dkonecny@netbeans.org> Log: #229648 - IDE locked when creating web service client - alternative fix in EJB module
Integrated into 'main-golden', will be available in build *201305172300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/637e74096694 User: Jan Lahoda <jlahoda@netbeans.org> Log: #229648: creating intermediate model between Java AST and Nodes, to prevent accessing Nodes locks under the parsing lock.
Transplanted into release73 branch as 1b5baae72474
Integrated into 'releases', will be available in build *201305202200* or newer. Wait for official and publicly available build. Changeset: http://hg.netbeans.org/releases/rev/1b5baae72474 User: David Konecny <dkonecny@netbeans.org> Log: #229648 - IDE locked when creating web service client - alternative fix in EJB module (transplanted from e40617d963be9460ed32bcd7ef00dc5803422ec2)