Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[master] New eclipselink dead lock scenario ... enhancement and unit test #2350

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rfelcman
Copy link
Contributor

Fixes #2094
This is enhancement for case of possible deadlock which should happens in org.eclipse.persistence.internal.sessions.AbstractSession#getCacheKeyFromTargetSessionForMerge method if used org.eclipse.persistence.internal.identitymaps.CacheKey instance is locked by another thread.
There is new system or persistence property eclipselink.concurrency.manager.allow.getcachekeyformerge.mode which can control org.eclipse.persistence.internal.sessions.AbstractSession#getCacheKeyFromTargetSessionForMerge logic to get org.eclipse.persistence.internal.identitymaps.CacheKey instance and object value behind this.
There are two allowed values:

  • ORIGIN (DEFAULT) - There is infinite java.lang.Object.wait() call in case of some conditions during time when object/entity referred from org.eclipse.persistence.internal.identitymaps.CacheKey is locked and modified by another thread. In some cases it should leads into deadlock.
  • WAITLOOP - Merge manager will try in the loop with timeout wait cacheKey.wait(ConcurrencyUtil.SINGLETON.getAcquireWaitTime()); fetch object/entity from org.eclipse.persistence.internal.identitymaps.CacheKey. If fetch will be successful object/entity loop finish and continue
    with remaining code. If not java.lang.InterruptedException is thrown and caught and used org.eclipse.persistence.internal.identitymaps.CacheKey instance status is set into invalidation state. This strategy avoid deadlock issue, but there should be impact to the performance.

@rfelcman rfelcman force-pushed the dead_lock_cache_key branch from ceff09d to b77aa2d Compare January 24, 2025 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant