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

Race condition with cached css and caching proxies

    • MOODLE_401_STABLE

      The site css might be under a url such as:

      /theme/styles.php/mytheme/1726031928_1726032167/allĀ 

      This css file internally is cached in the shared cache dir. However if there is any issues writing to this file, or later on reading from it, then it will serve an empty file with a 200 header and with the caching headers intact. So a downstream caching proxy like varnish or cdn will be poisoned with this bad version forever.

      So we need better error protection on both the writing and reading points

      fopen(/var/lib/moodlecache/cache/theme/1726031928/mytheme/css/all_1726032167.css.tmp): failed to open stream: No such file or directory in /var/www/site/lib/csslib.php on line 73

      stat failed for /var/lib/moodlecache/cache/theme/1726031928/mytheme/css/all_1726032167.css in /var/www/site/lib/csslib.php on line 97

      readfile(/var/lib/moodlecache/cache/theme/1726031928/mytheme/css/all_1726032167.css): failed to open stream: No such file or directory in /var/www/site/lib/csslib.php on line 107

      Working theory is a race condition with that directory being reset elsewhere at the same time the cache version numbers are reset, so the subdirectory is not readable.

            brendanheywood Brendan Heywood
            brendanheywood Brendan Heywood
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.