server icon indicating copy to clipboard operation
server copied to clipboard

enh(metadata): Introduce a memory limit for metadata generation

Open solracsf opened this issue 2 years ago • 5 comments

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_filesize param

Similar to:

https://github.com/nextcloud/server/blob/265e9060f87b4865485e0852724b0a2b398e0b6d/config/config.sample.php#L1241-L1249

Checklist

solracsf avatar Jan 15 '24 13:01 solracsf

Suggestion: Add the new parameter to config.sample.php here too

It's the ToDo point on the PR summary 😉

solracsf avatar Jan 19 '24 18:01 solracsf

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.

kesselb avatar Jun 16 '24 14:06 kesselb

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.

solracsf avatar Jun 16 '24 18:06 solracsf

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.

That's good, thank you :+1:

kesselb avatar Jun 26 '24 14:06 kesselb

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.

kesselb avatar Jun 27 '24 13:06 kesselb

/backport to stable29

st3iny avatar Jul 31 '24 12:07 st3iny

Psalm is failing because the latest rebase brought in https://github.com/nextcloud/server/pull/46450 that changed IConfig to IAppConfig.

kesselb avatar Jul 31 '24 14:07 kesselb