Uses of Class
org.eclipse.persistence.internal.helper.type.ConcurrencyManagerState
-
Uses of ConcurrencyManagerState in org.eclipse.persistence.internal.helper
Modifier and TypeMethodDescriptionConcurrencyUtil.createConcurrencyManagerState
(Map<Thread, DeferredLockManager> deferredLockManagers, Map<Thread, ReadLockManager> readLockManagersOriginal, Map<Thread, ConcurrencyManager> mapThreadToWaitOnAcquireOriginal, Map<Thread, String> mapThreadToWaitOnAcquireMethodNameOriginal, Map<Thread, Set<ConcurrencyManager>> mapThreadToWaitOnAcquireInsideWriteLockManagerOriginal, Map<Thread, ConcurrencyManager> mapThreadToWaitOnAcquireReadLockOriginal, Map<Thread, String> mapThreadToWaitOnAcquireReadLockMethodNameOriginal, Set<Thread> setThreadWaitingToReleaseDeferredLocksOriginal, Map<Thread, String> mapThreadsThatAreCurrentlyWaitingToReleaseDeferredLocksJustificationClone, Map<Thread, Set<Object>> mapThreadToObjectIdWithWriteLockManagerChangesOriginal) create a DTO that tries to represent the current snapshot of the concurrency manager and write lock manager cache stateModifier and TypeMethodDescriptionprotected String
ConcurrencyUtil.createInformationAboutAllResourcesAcquiredAndDeferredByAllThreads
(ConcurrencyManagerState concurrencyManagerState) Log information about all threads tracked in the concurrency manager.protected boolean
ExplainDeadLockUtil.currentThreadIsKnownToBeWaitingForAnyResource
(ConcurrencyManagerState concurrencyManagerStateDto, Thread currentCandidateThreadPartOfTheDeadLock) This a helper sanity check.protected void
ConcurrencyUtil.dumpConcurrencyManagerInformationStep02
(ConcurrencyManagerState concurrencyManagerState) Dump the server log all of the information that we managed to aggregate about the current state of the concurrency manager.protected String
ConcurrencyUtil.dumpDeadLockExplanationIfPossible
(ConcurrencyManagerState concurrencyManagerState) ExplainDeadLockUtil.explainPossibleDeadLockStartRecursion
(ConcurrencyManagerState concurrencyManagerState) Given the concurrency manager state try to explain why we are facing a dead lock.static IsBuildObjectCompleteOutcome
ExplainDeadLockUtil.isBuildObjectOnThreadComplete
(ConcurrencyManagerState concurrencyManagerStateDto, Thread thread, Map<Thread, Thread> recursiveSet) This method is nothing more than copy paste code from the algorithmConcurrencyManager.isBuildObjectOnThreadComplete(Thread, Map, List, boolean)
We re-write this code to instead of returning true/false return an actual DTO object that can allow our dead lock explanation algorithm to identify the next thread to expand to explain the dead lock.protected DeadLockComponent
ExplainDeadLockUtil.recursiveExpansionCurrentThreadBeingBlockedByActiveThreadOnCacheKey
(ConcurrencyManagerState concurrencyManagerState, int recursionMaxDepth, int currentRecursionDepth, Thread currentCandidateThreadPartOfTheDeadLock, List<Thread> threadPartOfCurrentDeadLockExpansion, Set<Thread> threadsAlreadyExpandedInThePastThatWeDoNotWantToExpandAgain, ConcurrencyManager cacheKeyThreadWantsToAcquireButCannotGet, boolean currentThreadWantsToAcquireForWriting) Try to expand the current thread from the perspective that it wants a cache key that may be own for writing by a competitor thread.protected DeadLockComponent
ExplainDeadLockUtil.recursiveExpansionCurrentThreadBeingBlockedByActiveWriters
(ConcurrencyManagerState concurrencyManagerState, int recursionMaxDepth, int currentRecursionDepth, Thread currentCandidateThreadPartOfTheDeadLock, List<Thread> threadPartOfCurrentDeadLockExpansion, Set<Thread> threadsAlreadyExpandedInThePastThatWeDoNotWantToExpandAgain, ConcurrencyManager cacheKeyThreadWantsToAcquireButCannotGet, boolean currentThreadWantsToAcquireForWriting) Try to expand the current thread from the perspective that it wants a cache key that may be own for writing by a competitor thread.protected DeadLockComponent
ExplainDeadLockUtil.recursiveExplainPossibleDeadLockStep01
(ConcurrencyManagerState concurrencyManagerStateDto, int recursionMaxDepth, int currentRecursionDepth, Thread currentCandidateThreadPartOfTheDeadLock, List<Thread> threadPartOfCurrentDeadLockExpansion, Set<Thread> threadsAlreadyExpandedInThePastThatWeDoNotWantToExpandAgain) The algorithm expands the current thread in depth.protected DeadLockComponent
ExplainDeadLockUtil.recursiveExplainPossibleDeadLockStep02
(ConcurrencyManagerState concurrencyManagerStateDto, int recursionMaxDepth, int currentRecursionDepth, Thread currentCandidateThreadPartOfTheDeadLock, List<Thread> threadPartOfCurrentDeadLockExpansion, Set<Thread> threadsAlreadyExpandedInThePastThatWeDoNotWantToExpandAgain) Precondition the logic ofExplainDeadLockUtil.recursiveExplainPossibleDeadLockStep01(ConcurrencyManagerState, int, int, Thread, List, Set)
has been invoked and determined that we need to go deeper and expand the current thread.protected DeadLockComponent
ExplainDeadLockUtil.recursiveExplainPossibleDeadLockStep03ExpandBasedOnCacheKeyWantedForWriting
(ConcurrencyManagerState concurrencyManagerStateDto, int recursionMaxDepth, int currentRecursionDepth, Thread currentCandidateThreadPartOfTheDeadLock, List<Thread> threadPartOfCurrentDeadLockExpansion, Set<Thread> threadsAlreadyExpandedInThePastThatWeDoNotWantToExpandAgain, ConcurrencyManager cacheKeyCurrentThreadWantsForWritingButCannotGet) We are looking at thread that we know has registered itself as wanting to acquire a write lock and not managing to make progress getting the write lock.protected DeadLockComponent
ExplainDeadLockUtil.recursiveExplainPossibleDeadLockStep03Scenario01CurrentWriterVsOtherWritersWriter
(ConcurrencyManagerState concurrencyManagerStateDto, int recursionMaxDepth, int currentRecursionDepth, Thread currentCandidateThreadPartOfTheDeadLock, List<Thread> threadPartOfCurrentDeadLockExpansion, Set<Thread> threadsAlreadyExpandedInThePastThatWeDoNotWantToExpandAgain, ConcurrencyManager cacheKeyCurrentThreadWantsForWritingButCannotGet) Expand the possibility of the current thread wanting to acquire for writing what some other already has acquired for writing.protected DeadLockComponent
ExplainDeadLockUtil.recursiveExplainPossibleDeadLockStep03Scenario02CurrentWriterVsOtherReader
(ConcurrencyManagerState concurrencyManagerState, int recursionMaxDepth, int currentRecursionDepth, Thread currentCandidateThreadPartOfTheDeadLock, List<Thread> threadPartOfCurrentDeadLockExpansion, Set<Thread> threadsAlreadyExpandedInThePastThatWeDoNotWantToExpandAgain, ConcurrencyManager cacheKeyCurrentThreadWantsForWritingButCannotGet) Expand the recursion exploring the possibility that the reason the current thread cannot acquire the cache key is because there are readers on the cache key.protected DeadLockComponent
ExplainDeadLockUtil.recursiveExplainPossibleDeadLockStep03Scenario03CurrentWriterVsCacheKeyActiveThread
(ConcurrencyManagerState concurrencyManagerStateDto, int recursionMaxDepth, int currentRecursionDepth, Thread currentCandidateThreadPartOfTheDeadLock, List<Thread> threadPartOfCurrentDeadLockExpansion, Set<Thread> threadsAlreadyExpandedInThePastThatWeDoNotWantToExpandAgain, ConcurrencyManager cacheKeyCurrentThreadWantsForWritingButCannotGet) In scenario 3 is when we start considering the possbility our data for detecting the dead lock is not ok or the cache is corrupted.protected DeadLockComponent
ExplainDeadLockUtil.recursiveExplainPossibleDeadLockStep04ExpandBasedOnThreadStuckOnReleaseDeferredLocks
(ConcurrencyManagerState concurrencyManagerStateDto, int recursionMaxDepth, int currentRecursionDepth, Thread currentCandidateThreadPartOfTheDeadLock, List<Thread> threadPartOfCurrentDeadLockExpansion, Set<Thread> threadsAlreadyExpandedInThePastThatWeDoNotWantToExpandAgain) When a thead cannot move forward due to having deferred cache keys, it means that the thread could not go as deep as it wanted during object building and hda to defer making some parts of the object.protected DeadLockComponent
ExplainDeadLockUtil.recursiveExplainPossibleDeadLockStep05ExpandBasedOnCacheKeyWantedForReading
(ConcurrencyManagerState concurrencyManagerStateDto, int recursionMaxDepth, int currentRecursionDepth, Thread currentCandidateThreadPartOfTheDeadLock, List<Thread> threadPartOfCurrentDeadLockExpansion, Set<Thread> threadsAlreadyExpandedInThePastThatWeDoNotWantToExpandAgain, ConcurrencyManager cacheKeyCurrentThreadWantsForReadingButCannotGet) In this case have a thread that wants to acquire for reading a cache key but it does not manage to acquire it because the cache key is being owned by somebody else.protected DeadLockComponent
ExplainDeadLockUtil.recursiveExplainPossibleDeadLockStep05Scenario01CurrentReaderVsOtherWriters
(ConcurrencyManagerState concurrencyManagerStateDto, int recursionMaxDepth, int currentRecursionDepth, Thread currentCandidateThreadPartOfTheDeadLock, List<Thread> threadPartOfCurrentDeadLockExpansion, Set<Thread> threadsAlreadyExpandedInThePastThatWeDoNotWantToExpandAgain, ConcurrencyManager cacheKeyCurrentThreadWantsForWritingButCannotGet) Expand the possibility of the current thread wanting to acquire for writing what some other already has acquired for writing.protected DeadLockComponent
ExplainDeadLockUtil.recursiveExplainPossibleDeadLockStep05Scenario02CurrentReaderVsCacheKeyActiveThread
(ConcurrencyManagerState concurrencyManagerStateDto, int recursionMaxDepth, int currentRecursionDepth, Thread currentCandidateThreadPartOfTheDeadLock, List<Thread> threadPartOfCurrentDeadLockExpansion, Set<Thread> threadsAlreadyExpandedInThePastThatWeDoNotWantToExpandAgain, ConcurrencyManager cacheKeyCurrentThreadWantsForWritingButCannotGet) Same asExplainDeadLockUtil.recursiveExplainPossibleDeadLockStep03Scenario03CurrentWriterVsCacheKeyActiveThread(ConcurrencyManagerState, int, int, Thread, List, Set, ConcurrencyManager)
but in this case our candidate thread is trying to get the cache key with the purpose of READING and not for writing.