enh(metadata): Introduce a memory limit for metadata generation
Summary
Fix https://github.com/nextcloud/server/issues/42793
By introducing a (configurable) memory limit, one should not reach OOM on very big files that the server can't support.
TODO
- [x] Once approved, document
metadata_max_filesizeparam
Similar to:
https://github.com/nextcloud/server/blob/265e9060f87b4865485e0852724b0a2b398e0b6d/config/config.sample.php#L1241-L1249
Checklist
- Code is properly formatted
- Sign-off message is added to all commits
- [ ] Tests (unit, integration, api and/or acceptance) are included
- [ ] Screenshots before/after for front-end changes
- [x] Documentation (manuals or wiki) has been updated or is not required
- [x] Backports requested where applicable (ex: critical bugfixes)
Suggestion: Add the new parameter to config.sample.php here too
It's the ToDo point on the PR summary 😉
Thank you, good idea :+1:
I think the decision "can this file be processed" should live in the actual event listeners. But the event listeners I checked all read the file, and therefore it's a practical approach.
The naming is a bit misleading because it's not a memory limit but a file size limit.
The naming is a bit misleading because it's not a memory limit but a file size limit.
If metadata_max_filesize fits best please let me know.
The naming is a bit misleading because it's not a memory limit but a file size limit.
If
metadata_max_filesizefits best please let me know.
That's good, thank you :+1:
Please don't forget to update the config.sample.php
I'm not sure how useful the debug log is, but without you have no idea why the metadata generation was skipped for a given file.
/backport to stable29
Psalm is failing because the latest rebase brought in https://github.com/nextcloud/server/pull/46450 that changed IConfig to IAppConfig.