mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 12:32:08 +02:00
MDL-72796 caching: fix retry delay for redis session cache
The random retry delay for redis session cache was calculated as rand(100000, 500000) giving an effective retry delay of 100 seconds to 500 seconds. That's off by a factor of a thousand! Using Redis as a session cache and when the connection hangs, you can get random "cannot obtain session lock" errors because it's waiting up to 500 seconds (or about 8.33 minutes) for a Redis connection. This sets the delay to the originally intended 100ms to 500ms. (see MDL-59866). Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
This commit is contained in:
parent
51149a78cc
commit
371b490a1f
@ -193,7 +193,7 @@ class redis extends handler {
|
||||
|
||||
try {
|
||||
|
||||
$delay = rand(100000, 500000);
|
||||
$delay = rand(100, 500);
|
||||
|
||||
// One second timeout was chosen as it is long for connection, but short enough for a user to be patient.
|
||||
if (!$this->connection->connect($this->host, $this->port, 1, null, $delay)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user