Community
Participate
Working Groups
Build Identifier: Build id: I20110310-1119 Holds synchronized lock on JSPTranslationAdapter while trying to acquire SYNC in ModelManagerImpl:1248 Thread[Java indexing,4,main] java.lang.Object.wait(Native Method) at org.eclipse.core.internal.jobs.Semaphore.acquire(Semaphore.java:39) at org.eclipse.core.internal.jobs.OrderedLock.doAcquire(OrderedLock.java:176) at org.eclipse.core.internal.jobs.OrderedLock.acquire(OrderedLock.java:110) at org.eclipse.core.internal.jobs.OrderedLock.acquire(OrderedLock.java:84) at org.eclipse.wst.sse.core.internal.model.ModelManagerImpl.getExistingModelForRead(ModelManagerImpl.java:1248) at org.eclipse.jst.jsp.core.internal.taglib.TaglibHelper.getModelQuery(TaglibHelper.java:816) at org.eclipse.jst.jsp.core.internal.taglib.TaglibHelper.getCustomTag(TaglibHelper.java:244) at org.eclipse.jst.jsp.core.internal.java.JSPTranslator.addStartTagVariable(JSPTranslator.java:957) at org.eclipse.jst.jsp.core.internal.java.JSPTranslator.addTaglibVariables(JSPTranslator.java:906) at org.eclipse.jst.jsp.core.internal.java.JSPTranslator.addTaglibVariables(JSPTranslator.java:892) at org.eclipse.jst.jsp.core.internal.java.XMLJSPRegionHelper.nodeParsed(XMLJSPRegionHelper.java:195) at org.eclipse.jst.jsp.core.internal.java.XMLJSPRegionHelper.parse(XMLJSPRegionHelper.java:162) at org.eclipse.jst.jsp.core.internal.java.JSPTranslator.handleIncludeFile(JSPTranslator.java:2310) at org.eclipse.jst.jsp.core.internal.java.JSPTranslator.translateXMLNode(JSPTranslator.java:1532) at org.eclipse.jst.jsp.core.internal.java.JSPTranslator.translateRegionContainer(JSPTranslator.java:1352) at org.eclipse.jst.jsp.core.internal.java.JSPTranslator.translate(JSPTranslator.java:1127) at org.eclipse.jst.jsp.core.internal.java.JSPTranslationAdapter.getJSPTranslation(JSPTranslationAdapter.java:153) at org.eclipse.jst.jsp.core.internal.java.search.JSPSearchDocument.getJSPTranslation(JSPSearchDocument.java:120) at org.eclipse.jst.jsp.core.internal.java.search.JSPSearchDocument.getCharContents(JSPSearchDocument.java:77) at org.eclipse.jst.jsp.core.internal.java.search.JavaSearchDocumentDelegate.getCharContents(JavaSearchDocumentDelegate.java:41) at org.eclipse.jdt.internal.core.search.indexing.SourceIndexer.indexDocument(SourceIndexer.java:60) at org.eclipse.jdt.internal.core.search.JavaSearchParticipant.indexDocument(JavaSearchParticipant.java:72) at org.eclipse.jst.jsp.core.internal.java.search.JSPSearchParticipant.indexDocument(JSPSearchParticipant.java:72) at org.eclipse.jdt.internal.core.search.indexing.IndexManager.indexDocument(IndexManager.java:453) at org.eclipse.jdt.internal.core.search.indexing.IndexManager$1.execute(IndexManager.java:853) at org.eclipse.jdt.internal.core.search.processing.JobManager.run(JobManager.java:405) at java.lang.Thread.run(Thread.java:619) Trying to synchronize on JSPTranslationAdapter:120 holds lock SYNC in ModelManagerImpl acquired at ModelManagerImpl:1801 Thread[Worker-27,5,main] org.eclipse.jst.jsp.core.internal.java.JSPTranslationAdapter.release(JSPTranslationAdapter.java:120) at org.eclipse.jst.jsp.core.internal.java.JSPTranslationAdapterFactory.release(JSPTranslationAdapterFactory.java:65) at org.eclipse.wst.sse.core.internal.model.FactoryRegistry.release(FactoryRegistry.java:142) at org.eclipse.wst.sse.core.internal.model.ModelManagerImpl.cleanupDiscardedModel(ModelManagerImpl.java:1879) at org.eclipse.wst.sse.core.internal.model.ModelManagerImpl.discardModel(ModelManagerImpl.java:1869) at org.eclipse.wst.sse.core.internal.model.ModelManagerImpl.releaseFromEdit(ModelManagerImpl.java:1805) at org.eclipse.wst.sse.core.internal.model.ModelManagerImpl.releaseFromEdit(ModelManagerImpl.java:1761) at org.eclipse.wst.sse.core.internal.model.AbstractStructuredModel.releaseFromEdit(AbstractStructuredModel.java:1044) at org.eclipse.wst.xml.core.internal.document.DOMModelImpl.releaseFromEdit(DOMModelImpl.java:870) at org.eclipse.wst.html.core.internal.document.DOMStyleModelImpl.releaseFromEdit(DOMStyleModelImpl.java:37) at oracle.eclipse.tools.webtier.common.services.jsp.include.model.MergedModel$1.run(MergedModel.java:199) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54 Reproducible: Sometimes
It appears this deadlock was caused by the fix to bug 329397 which changed JSPTranslationAdapter#release to be synchronized.
(In reply to comment #1) > It appears this deadlock was caused by the fix to bug 329397 which changed > JSPTranslationAdapter#release to be synchronized. Yup, that's definitely appears to be the case. Thanks, Andrew. We might be able to tighten things up a little for when synchronization occurs.
Created attachment 193944 [details] patch Synchronization on release() was unnecessary.
* Explain why you believe this is a stop-ship defect. Or, if it is a "hotbug" (requested by an adopter) please document it as such. This is a deadlock that can occur due to code introduced in 3.2.3. Quickly resolving this will hopefully lead to fewer people hitting this problem. * Is there a work-around? If so, why do you believe the work-around is insufficient? No. * How has the fix been tested? Is there a test case attached to the bugzilla record? Has a JUnit Test been added? Existing unit tests have been run in addition to ad hoc testing. * Give a brief technical overview. Who has reviewed this fix? In 3.2.3, the release() method was made synchronized. This is troublesome because it is called while the model lock is held during model cleanup, which opened us up to deadlock. This method should have never been made synchronized in the first place because it is unnecessary during the release of the adapter. * What is the risk associated with this fix? Low.
OK with fix, so no call within this method should be protected?
(In reply to comment #5) > OK with fix, so no call within this method should be protected? Nope. The synchronization here in the first place was a mistake. Thanks for the reviews.