-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding limits on file uploads #475
Conversation
Passing run #479 ↗︎
Details:
Review all test suite changes for PR #475 ↗︎ |
36dc8a9
to
1fee301
Compare
Looks good to me, but I would set the max files and filesize much lower, at least for a demo folder. I can't think of a case we currently need to support 10,000 files uploaded at once-- and I imagine the server would not be happy. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
…e setting; make default 100 GB
…if missing on upload [could indicate unmounted fs]
1fee301
to
8ceae6d
Compare
If the 10,000 were tracked as one "file object" in the database then I think it would be fine -- doesn't seem unreasonable once we move to uploading folders of in situ data, or even bruker folders, but take your point for the demo server |
Closes #471 by adding file upload limits:
MAX_CONTENT_SIZE
-- now this value is configurable to prevent massive files filling/tmp
disks that could lead to instability on some systems -- think we are unaffected on the current deployment but will try to verify laterCONFIG.FILE_DIRECTORY
to actually store the thing. This is done with a pymongo lock that prevents new files being uploaded until previous files have been correctly stored in the fs and database.Also this PR makes the files directory on app startup, if not present. Previously the routes themselves were making it on first upload, potentially with all required subdirectories. This can be a bit dangerous if the files directory is a dynamic mount point, as the wrong disk may silently be used if not previously mounted. We should probably make this more robust in the future, with better specification of e.g. remote data sources too for the files directory (S3 or other blob storage). May be worth abstracting this away with something like Maggma as a "store" controller but equally this may overcomplicate things for little gain for us.
Additionally, in the future/now if easily done, it would be nice to add better feedback on failures in the UI, i.e., overriding the default uppy error message with better messages directly from our API. This might be straightforward to do but tricky to test.