From: Aaron Schulz Date: Fri, 30 Sep 2016 13:36:35 +0000 (-0700) Subject: Use MAX_LOCK_TTL in RedisLockManager to avoid premature lock expiration X-Git-Tag: 1.31.0-rc.0~5260^2 X-Git-Url: http://git.cyclocoop.org/wiki/Target_page?a=commitdiff_plain;h=e1505ff742140b04dc8ff8bbc1d9fb12ccdbc2a0;p=lhc%2Fweb%2Fwiklou.git Use MAX_LOCK_TTL in RedisLockManager to avoid premature lock expiration App servers should not lower the redis structure TTL of locks set from CLI scripts, which is what would typically happen before if they touched the same keys. Instead, keep a high lock record TTL and rely on the logical TTLs for expiry semantics. Change-Id: I2948369845c47d2682a85dd0564673f3b813be83 --- diff --git a/includes/libs/lockmanager/RedisLockManager.php b/includes/libs/lockmanager/RedisLockManager.php index 6001705ff8..ea9dde7f2a 100644 --- a/includes/libs/lockmanager/RedisLockManager.php +++ b/includes/libs/lockmanager/RedisLockManager.php @@ -102,7 +102,7 @@ class RedisLockManager extends QuorumLockManager { <<session, // ARGV[1] $this->lockTTL, // ARGV[2] - time() // ARGV[3] + self::MAX_LOCK_TTL, // ARGV[3] + time() // ARGV[4] ] ), count( $pathsByKey ) # number of first argument(s) that are keys