-
Bug
-
Resolution: Fixed
-
Major
-
3.10
-
MOODLE_310_STABLE
-
MOODLE_310_STABLE, MOODLE_39_STABLE
-
MDL-70631-master-unzip -
It takes extremely long to extract a ZIP archive, especially if it contains many files.
This was originally raised as MDLSITE-6114 and MDLSITE-6129 where plugin developers experienced timeouts when they were submitting plugins to the Plugins directory. Moodle did not manage to extract the submitted ZIP and timed out.
Comments in MDLSITE-6129 have the whole story, the executive summary follows.
stronk7 correctly identified the bottleneck in the current implementation of zip_packer::extract_to_pathname() which iterates over all files in the archive, obtains a stream resource for each of the files, reads from the stream in 256KB blocks and writes them into the target location. ZipArchive::getStream() takes significant time in this whole chain and if there are many files (e.g. a plugin with vendor folder), the difference becomes significant.
It was suggested to switch to the alternative implementation that makes use of ZipArchive::extractTo(). That was confirmed to have significantly improved performance. During the development, a PHP bug in the ZipArchive extensions was discovered and communicated upstream.
This issue brings a new version of the method which works significantly faster than the previous implementation and has work around for the said upstream PHP bug.
- caused a regression
-
MDL-70864 Problem with zip_packer under Windows
- Closed
- has a non-specific relationship to
-
MDL-41147 Large course restore fails due to time limit when unzipping
- Closed
-
MDL-70608 Update language pack installs / updates to run asynchronously to avoid timeouts when multiple are used
- Closed
- has been marked as being related by
-
MDLSITE-6263 Unable to update Plugins db for auth_saml2
- Development in progress
- will help resolve
-
MDLSITE-6114 Timeout when uploading .zip file with new plugin
- Resolved
-
MDLSITE-6129 Timeout on uploading new version of plugin to plugins directory
- Resolved
-
MDL-70014 Random behat failures with tool_customlang scenarios (timeout)
- Closed