Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -474,15 +474,13 @@ public LockItem acquireLock(final AcquireLockOptions options) throws LockNotGran
String id = existingLock.get().getUniqueIdentifier();
// Let's check to see if this existingLock expired based on old data we cached.
// Or cache it if we haven't seen this recordVersion before.
LockItem cachedLock = notMyLocks.get(id);
boolean isReallyExpired = false;
if (notMyLocks.containsKey(id) &&
notMyLocks.get(id).getRecordVersionNumber()
.equals(existingLock.get().getRecordVersionNumber())) {

isReallyExpired = notMyLocks.get(id).isExpired();
if (cachedLock != null && cachedLock.getRecordVersionNumber().equals(existingLock.get().getRecordVersionNumber())) {
isReallyExpired = cachedLock.isExpired();
if (isReallyExpired) {
// short circuit the waiting that we normally do.
lockTryingToBeAcquired = notMyLocks.get(id);
lockTryingToBeAcquired = cachedLock;
}
} else {
notMyLocks.put(id, existingLock.get());
Expand Down