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

PHP 7 sessions using memcached (3.x.x) : MDL-53947 causes regression (from MDL-53713)

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.0.5, 3.0.6, 3.0.7, 3.0.8, 3.1.1, 3.1.2, 3.1.3, 3.2, 3.2.5, 3.3.2, 3.4
    • 3.2.6, 3.3.3
    • Caching, General
    • PHP 7.0, session handler memcached 3.x

    Description

      For an installation using PHP 7 and memcached (3.x) for sessions, MDL-53947 mis-configures the the memcached.sess_lock_wait_max value (default 2 sec.) to be acquiretimeout * 1000 (effectively 120 sec.).

      Unfortunately, the docs are not .... what they could be, and were misinterpreted.

      The names for the memcached configs were not simply altered; the entire scheme of polling for a session lock was changed, and the two _max and _min configs have entirely different uses. There is no longer a config that correlates directly to how long you wait for a session lock before giving up.

      Reviewing the code change, the _min and _max values determine the initial (_min) and subsequent (_max) values passed to usleep()--with a twist. Between each attempt, the argument is adjusted to be the minimum of the _max value or 2 X the last used value.

      Using the values from config-dist.php in conjunction with the MDL-53947 code modification results in a max lock timeout of 31 seconds (rather than the 120 you expect); this reduced timeout value (not matching the acquiretimeout value) breaks MDL-53713--for PHP7 + memcached sessions.

      Attachments

        Issue Links

          Activity

            People

              woolardfa@appstate.edu Fred Woolard
              woolardfa@appstate.edu Fred Woolard
              Mark Nelson Mark Nelson
              Andrew Lyons Andrew Lyons
              Damyon Wiese Damyon Wiese
              Matteo Scaramuccia, David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo, Adrian Greeve, David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              4 Vote for this issue
              Watchers:
              17 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                13/Nov/17