Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-72796

retry interval in milliseconds for redis session cache is far too high

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Peer review in progress
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.9.10, 3.10.7, 3.11.3
    • Fix Version/s: None
    • Component/s: Caching
    • Labels:

      Description

      In lib/classes/session/redis.php on Line 196, a random delay between 100000 and 500000 is selected. It is further used as the 5th parameter for the Redis->connect() call. That's the $retryInterval, a retry interval in milliseconds.

      This means we are effectively waiting with a retry delay of 100 seconds to 500 seconds. The indented wait should be 100 ms to 500 ms, see here for reference.
      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.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              Daniel Ziegenberg Daniel Ziegenberg
              Peer reviewer:
              Brendan Heywood Brendan Heywood
              Participants:
              Component watchers:
              Matteo Scaramuccia, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
              Votes:
              3 Vote for this issue
              Watchers:
              12 Start watching this issue

                Dates

                Created:
                Updated: