Skip to content

Commit

Permalink
HA: check expiration of individual locks (outside Tis)
Browse files Browse the repository at this point in the history
Fixed issue #5012.
  • Loading branch information
lvca committed Jul 13, 2017
1 parent da8853f commit cd53b84
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1178,6 +1178,24 @@ public void run() {
}
}
}

// CHECK INDIVIDUAL LOCKS TOO
for (final Iterator<Map.Entry<ORID, ODistributedLock>> it = lockManager.entrySet().iterator(); it.hasNext(); ) {
final Map.Entry<ORID, ODistributedLock> entry = it.next();

final ODistributedLock lock = entry.getValue();
if (lock != null) {
final long elapsed = now - lock.acquiredOn;
if (elapsed > timeout) {
// EXPIRED
ODistributedServerLog.debug(this, localNodeName, null, DIRECTION.NONE,
"Distributed lock on database '%s' record %s is expired after %dms", databaseName, entry.getKey(), elapsed);

it.remove();
}
}
}

} catch (Throwable t) {
// CATCH EVERYTHING TO AVOID THE TIMER IS CANCELED
ODistributedServerLog.info(this, localNodeName, null, DIRECTION.NONE,
Expand Down

0 comments on commit cd53b84

Please sign in to comment.