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

Per-request temp directories

    XMLWordPrintable

Details

    • MySQL
    • MOODLE_26_STABLE, MOODLE_28_STABLE
    • MOODLE_29_STABLE
    • MDL-44874-master
    • Moderate
    • Hide
      1. Run provided unit tests

      The unit tests do not cover race conditions. If you can think of some witty and novel way of testing race conditions, please do!

      Show
      Run provided unit tests The unit tests do not cover race conditions. If you can think of some witty and novel way of testing race conditions, please do!
    • 40
    • Team Beards Sprint 5
    • Large

    Description

      According to the docs: "If any script tries to use temp files that were not created during current request it is a bug that needs to be fixed."

      Now in load balanced environment (without sticky sessions) with multiple web servers and local temp dirs defined on the web servers local file systems, there are at least two cases where files are used for more than the current request:

      • upload users via CSV
      • restoring course backups

      Trying to perform the above actions leads to errors and the inability to complete the actions unless the local tempidr "$CFG->tempdir" is removed from the configuration, losing the local tempdir functionality.

      This issue introduces a new function:

      make_request_directory($exceptiononerror = true);
      

      This can be used in the same way as make_temp_directory(), but it does not take a subdirectory as an argument.
      It always outputs the full path to the new directory, and ensures that it will be deleted after the request finishes.

      Attachments

        Issue Links

          Activity

            People

              dobedobedoh Andrew Lyons
              andreabix Andrea Bicciolo
              Simey Lameze Simey Lameze
              David Monllaó David Monllaó
              John Okely John Okely
              Adrian Greeve, David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo, Matteo Scaramuccia, David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo, Matteo Scaramuccia, David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              7 Vote for this issue
              Watchers:
              16 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                11/May/15