summaryrefslogtreecommitdiffstats
path: root/system/libraries/Session/drivers/Session_redis_driver.php
diff options
context:
space:
mode:
authorMichael Long <mchobbylong@gmail.com>2019-03-02 11:36:17 +0100
committerMichael Long <mchobbylong@gmail.com>2019-03-02 11:36:17 +0100
commit2fbe1fa8e6515f603ac788f2f49c83ba24f485eb (patch)
treea4d1623519ab888c767e9becd1f6a321b36f3fd7 /system/libraries/Session/drivers/Session_redis_driver.php
parent493ed6c472af3270cf995647a02c385c7f0500b3 (diff)
Resolve race condition in redis driven session key get_lock
Diffstat (limited to 'system/libraries/Session/drivers/Session_redis_driver.php')
-rw-r--r--system/libraries/Session/drivers/Session_redis_driver.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/system/libraries/Session/drivers/Session_redis_driver.php b/system/libraries/Session/drivers/Session_redis_driver.php
index 07511e555..7262a2300 100644
--- a/system/libraries/Session/drivers/Session_redis_driver.php
+++ b/system/libraries/Session/drivers/Session_redis_driver.php
@@ -389,8 +389,9 @@ class CI_Session_redis_driver extends CI_Session_driver implements SessionHandle
if ( ! $result)
{
- log_message('error', 'Session: Error while trying to obtain lock for '.$this->_key_prefix.$session_id);
- return FALSE;
+ // Sleep for 0.1s to wait for lock releases.
+ usleep(100000);
+ continue;
}
$this->_lock_key = $lock_key;