summaryrefslogtreecommitdiffstats
path: root/system/libraries/Session/drivers/Session_database_driver.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2015-03-04 12:33:39 +0100
committerAndrey Andreev <narf@devilix.net>2015-03-04 12:33:39 +0100
commite1a5bb345b1b30ea777348efa9cade21c1f2e2fb (patch)
tree98d07a56eb201818bdc274ba052d402e13841de1 /system/libraries/Session/drivers/Session_database_driver.php
parentfd08d02b1984d8f27a5e447a5c9d5e190271ab5e (diff)
Fix #3627: Keep timed locks for more than 5 seconds
Emulated locks for Redis and Memcached now have a TTL of 300 seconds (the default HTTP request timeout value on many environments) and 30 attemps, each separated by sleep(1), are made by the blocked request to try and obtain a lock if it has been freed. Additionaly, the blocking time for MySQL's locks, which are also timed, is also set to 300 seconds.
Diffstat (limited to 'system/libraries/Session/drivers/Session_database_driver.php')
-rw-r--r--system/libraries/Session/drivers/Session_database_driver.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/system/libraries/Session/drivers/Session_database_driver.php b/system/libraries/Session/drivers/Session_database_driver.php
index f496b4fe0..76c1cf34e 100644
--- a/system/libraries/Session/drivers/Session_database_driver.php
+++ b/system/libraries/Session/drivers/Session_database_driver.php
@@ -319,7 +319,7 @@ class CI_Session_database_driver extends CI_Session_driver implements SessionHan
if ($this->_platform === 'mysql')
{
$arg = $session_id.($this->_config['match_ip'] ? '_'.$_SERVER['REMOTE_ADDR'] : '');
- if ($this->_db->query("SELECT GET_LOCK('".$arg."', 10) AS ci_session_lock")->row()->ci_session_lock)
+ if ($this->_db->query("SELECT GET_LOCK('".$arg."', 300) AS ci_session_lock")->row()->ci_session_lock)
{
$this->_lock = $arg;
return TRUE;