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

Cache warning when editing activity settings

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Development in progress
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.8.2
    • Fix Version/s: None
    • Component/s: Caching
    • Labels:
      None

      Description

      If modinfo cache is stored on a slow network file store, editing an activity can result in a PHP warning being generated like the one below:

      Warning: fopen(/srv/learn2syst.open.ac.uk/www/moodledata/cache/cachestore_file/default_application/core_coursemodinfo/207-cache/207580-22c7dec4171a7f359d9f6fcf6aa429ea.cache): failed to open stream: No such file or directory in /srv/learn2syst.open.ac.uk/www/html/cache/stores/file/lib.php on line 358

      What appears to be happening is that the cache is cleared due to setting being changed, but it takes a while for the cache files to actually be deleted due to network latency. When the cached data for the activity is requested, the file still exists, but by the time we try to actually read the file, its gone. This is fine, and is handled in the code, however the warning is still eithe displayed or logged.

      A sensible solution with be to change fopen to @fopen on https://github.com/moodle/moodle/blob/master/cache/stores/file/lib.php#L358, and suppress the warning.

        Attachments

          Activity

            People

            Assignee:
            matteo Matteo Scaramuccia
            Reporter:
            marxjohnson Mark Johnson
            Peer reviewer:
            Mark Johnson
            Participants:
            Component watchers:
            Matteo Scaramuccia, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: