-
Improvement
-
Resolution: Fixed
-
Critical
-
2.6, 2.8.2
-
MySQL
-
MOODLE_26_STABLE, MOODLE_28_STABLE
-
MOODLE_29_STABLE
-
MDL-44874-master -
Moderate
-
-
40
-
Team Beards Sprint 5
-
Large
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.
- has been marked as being related by
-
MDL-49600 Fix tool_installaddon to not abuse make_temp_directory
- Closed
-
MDL-66928 Cron throws exceptions during a cache purge as localcachedir is purged / get_request_storage_directory should use system temp
- Closed
-
MDL-52674 Consider use of tempdir in file_storage API
- Closed
- is duplicated by
-
MDL-49579 Add a per-request directory helper
- Closed
- will help resolve
-
MDL-49725 Per-request temp directories (backport of MDL-44874)
- Closed