-
Bug
-
Resolution: Cannot Reproduce
-
Minor
-
None
-
2.5.1
-
None
-
MOODLE_25_STABLE
The configuration option $CFG->preventfilelocking should enable deployments on file systems that may have difficulties with calls to flock and file_put_contents with the LOCK_EX or LOCK_SH options. But there are a few places in the code where for example LOCK_EX is used without checking for this configuration option.
An rgrep LOCK_EX returns for example ./filestorage/file_storage.php and ./pluginlib.php
Background: we deploy moodle_data on Lustre (a shared filesystem) and encountered a similar problem to that reported here: https://tracker.moodle.org/browse/MDL-31685 . This time, there were problems generating thumbnails, giving an error in line 1761 of /lib/filestorage/file_storage.php . We solved our problem removing the LOCK_EX in line 1757 of file_put_contents($hashfile.'.tmp', $content, LOCK_EX)
I appreciate that these are attempts to prevent race-conditions, and I don't understand why Lustre (and maybe NFS?) sometimes have difficulties with the LOCK_EX option, but probably the preventfilelocking option should work as advertised.
- has a non-specific relationship to
-
MDL-41058 "filesize(): stat failed" warnings from cache when running multiple front ends
-
- Closed
-