moodle-tool_objectfs
moodle-tool_objectfs copied to clipboard
Correctly handle intermittent issues connecting to s3
There is possibly 2 issues that overlap and make things worse.
The first issue is there is some intermittent reason why it cannot connect to s3. This is the root cause and being addressed elsewhere, but when it can't read a number of knock on effects happen:
- it can't read the file so the object ends up being set to OBJECT_LOCATION_ERROR
https://github.com/catalyst/moodle-tool_objectfs/blob/59a8783739b7e6a4865a56f46a030436cb71d96e/classes/local/store/object_file_system.php#L215-L225
This then heals later based on the cron recover task
- The file still ends up being served as a 200 which in many cases then gets cached in the browser. This must throw an exception and end up as a 40x or 50x so it will not be cached.