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

CSS Generation never locks correctly

    Details

    • Testing Instructions:
      Hide
      1. Open theme/styles.php in your editor and add some debugging using error_log just before, and just after the call to get_lock(), and another call in the two places that the lock is released.
      2. Ensure that theme designer mode is disabled and purge caches
      3. Open a couple of browsers (Chrome + Chrome private browsing + Firefox + Firefox private browsing) and hit the site at the same time
      4. Tail the error log and ensure that you attempt to get a lock for each browser session - only one of them will get a session

      Note: You cannot just use multiple tabs in the same browser because the browser rate limits calls to the same URL for the same cookie session (from what I can tell)

      Show
      Open theme/styles.php in your editor and add some debugging using error_log just before, and just after the call to get_lock() , and another call in the two places that the lock is released. Ensure that theme designer mode is disabled and purge caches Open a couple of browsers (Chrome + Chrome private browsing + Firefox + Firefox private browsing) and hit the site at the same time Tail the error log and ensure that you attempt to get a lock for each browser session - only one of them will get a session Note: You cannot just use multiple tabs in the same browser because the browser rate limits calls to the same URL for the same cookie session (from what I can tell)
    • Affected Branches:
      MOODLE_32_STABLE, MOODLE_33_STABLE, MOODLE_34_STABLE
    • Fixed Branches:
      MOODLE_32_STABLE, MOODLE_33_STABLE
    • Pull 3.2 Branch:
    • Pull 3.3 Branch:
    • Pull Master Branch:
      MDL-59154-master

      Description

      https://github.com/moodle/moodle/blob/78ab4f741b1ba9922e4a3dd3f4f686f9b671d0de/theme/styles.php#L157 means that the styles.php never locks.
      This causes all processes to fight for resources and slows down the SCSS creation as a result.

      The accepted values for the $type variable are:

      • editor
      • all
      • all-rtl

      See https://github.com/moodle/moodle/blob/78ab4f741b1ba9922e4a3dd3f4f686f9b671d0de/theme/styles.php#L66 ealier in the file where this is enforced.
      The value can never be either less, or scss and therefore we currently never lock.

      This is really bad for performance on systems with multiple accesses from different users/browsers at once during CSS generation - so basically any non-dev system out there.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  5 Vote for this issue
                  Watchers:
                  11 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    10/Jul/17