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.
org.netbeans.api.registry.Context.putObject() called during process of instantiation from template (from different thread) cause deadlock. It can occure even in other situations but this case is 100% reproducible.
Created attachment 11446 [details] Thread Dump
David, can you look to the deadlock?
Please attach the whole thread dump. It seems to me that something is missing. From the attached stack trace it looks to me that problem is: project's NewFileAction instantiates template in "Module-Actions" thread and waits for ConfigurationManager.MUTEX.enterReadAccess(). Who holds write access to this mutex is not clear to me. Passing to projects for their opinion on this. The rest seems to be side effect of this: * "Default RequestProcessor" thread gets blocked because of "Module-Actions" thread: the "Module-Actions" thread is in DataObjectPool.runAtomicAction() * similarly "Settings Processor" requires read access on Registry mutex, but "Default RequestProcessor" thread which modifies some Registry values is holding the write acess on this mutex So the question is who holds the write access on ConfigurationManager.MUTEX? Or am I missing something?
It looks like during Java template instantiation is fistly locked DataObjectPool and then ConfigurationManager. But my thread simply binds new settings to Context (that is the ConfiguraionManager lock) and this action lately tries to lock DataObjectPool (might be creation of new settings InstanceDataObject). So deadlock is probably between template instantiation process and my asynchronous Context.putObject() call. Is there anything to be synchronized (inside core or in my code)?
IMO likely to be an artifact of the use of old DS & Settings API as the current Registry impl.
I would suggest to fix issue 36347 instead (which blocks issue 35050). That will resolve this problem.
As described in http://www.netbeans.org/servlets/ReadMsg?msgId=619519&listName=nbdiscuss the current work on projects prototype has been stopped.
Marking issue as VERIFIED --->
---> CLOSED