Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 312480 - ReadLocks acquired during distributed merge can result in deadlock
Summary: ReadLocks acquired during distributed merge can result in deadlock
Status: RESOLVED WORKSFORME
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-11 14:17 EDT by Gordon Yorke CLA
Modified: 2022-06-09 10:29 EDT (History)
1 user (show)

See Also:


Attachments
proposed patch (9.25 KB, patch)
2010-05-11 16:22 EDT, Gordon Yorke CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gordon Yorke CLA 2010-05-11 14:17:58 EDT
During the distributed merge process (cache co-ordination) if a related object has no changes but is needed for the merge then a readlock will be acquired.  This is very similar to bug 261910 and has the same symptoms except the call stack starts in the distributed merge.
Comment 1 Gordon Yorke CLA 2010-05-11 14:27:38 EDT
Symptoms:

	at java.lang.Object.wait(Native Method)
	- waiting on <0x00002aab5f0172e8> (a org.eclipse.persistence.internal.helper.ConcurrencyManager)
	at java.lang.Object.wait(Object.java:485)
	at org.eclipse.persistence.internal.helper.ConcurrencyManager.acquireReadLock(ConcurrencyManager.java:248)
	- locked <0x00002aab5f0172e8> (a org.eclipse.persistence.internal.helper.ConcurrencyManager)
	at org.eclipse.persistence.internal.helper.ConcurrencyManager.checkReadLock(ConcurrencyManager.java:236)
	at org.eclipse.persistence.internal.identitymaps.CacheKey.checkReadLock(CacheKey.java:180)
	at org.eclipse.persistence.internal.identitymaps.IdentityMapManager.getFromIdentityMap(IdentityMapManager.java:702)
	at org.eclipse.persistence.internal.identitymaps.IdentityMapManager.getFromIdentityMap(IdentityMapManager.java:667)
	at org.eclipse.persistence.internal.sessions.ObjectChangeSet.getTargetVersionOfSourceObject(ObjectChangeSet.java:367)
	at org.eclipse.persistence.internal.sessions.ObjectChangeSet.getTargetVersionOfSourceObject(ObjectChangeSet.java:336)
	at org.eclipse.persistence.internal.queries.ContainerPolicy.mergeCascadeParts(ContainerPolicy.java:1067)
	at org.eclipse.persistence.internal.queries.ContainerPolicy.mergeChanges(ContainerPolicy.java:1132)
	- locked <0x00002aac47407aa0> (a java.util.HashSet)
	at org.eclipse.persistence.mappings.CollectionMapping.mergeChangesIntoObject(CollectionMapping.java:1267)
	at org.eclipse.persistence.internal.descriptors.ObjectBuilder.mergeChangesIntoObject(ObjectBuilder.java:2636)
	at org.eclipse.persistence.internal.sessions.MergeManager.mergeChangesIntoDistributedCache(MergeManager.java:439)
Comment 2 Gordon Yorke CLA 2010-05-11 16:22:40 EDT
Created attachment 168028 [details]
proposed patch

This patch changes the process from acquiring a readlock to transitioning to deferred locks if the readlock can not be obtained.
Comment 3 Gordon Yorke CLA 2010-05-13 08:31:10 EDT
This is not a bug.  The Distributed merge does not acquire locks.  The reported deadlock appears to be a thread dump taken mid-run in a running system and does not indicate a deadlock.
Comment 4 Eclipse Webmaster CLA 2022-06-09 10:14:52 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink
Comment 5 Eclipse Webmaster CLA 2022-06-09 10:29:04 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink