Skip to content
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

Background job to cleanup leftover chunked uploads #12227

Merged
merged 2 commits into from
Jan 7, 2019

Conversation

rullzer
Copy link
Member

@rullzer rullzer commented Nov 2, 2018

If a chunked uploads fails for some reason the chunks should be cleaned up at some point in time. Else they can quickly fillup a disk.

When a chunked collection is created a backgroundjob is inserted.
This job is deleted when the chunked upload completes sucsessfully

The job will check if all files have an mtime of more than 24 hours. If so it will kill the folder. So as long as you upload 1 chunk every 24 hours it will not kill them.

TODO:

  • Proper DI
  • Add an initial repair step that inserts a backgroundjob for all the existing upload folders
    • probably best to have a background job for all the users inserted that does this

CC: @MorrisJobke since we discussed this recently

@rullzer rullzer added this to the Nextcloud 15 milestone Nov 2, 2018
@MorrisJobke MorrisJobke mentioned this pull request Nov 6, 2018
29 tasks
@rullzer rullzer removed this from the Nextcloud 15 milestone Nov 7, 2018
@rullzer rullzer added this to the Nextcloud 16 milestone Jan 3, 2019
Copy link
Member

@MorrisJobke MorrisJobke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code makes sense so far 👍

apps/dav/lib/BackgroundJob/UploadCleanup.php Outdated Show resolved Hide resolved
apps/dav/lib/BackgroundJob/UploadCleanup.php Outdated Show resolved Hide resolved
@MorrisJobke
Copy link
Member

I guess this is addressing #8759

@rullzer
Copy link
Member Author

rullzer commented Jan 3, 2019

@MorrisJobke yes. But this is only for upload using the new chunked upload. However most are now days.

@rullzer rullzer force-pushed the bugfix/cleanu_upload_folders branch from 2768cd6 to adb2b9a Compare January 4, 2019 08:21
@rullzer rullzer added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Jan 4, 2019
Copy link
Member

@blizzz blizzz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense

@rullzer
Copy link
Member Author

rullzer commented Jan 6, 2019

@MorrisJobke ready for review

Copy link
Member

@MorrisJobke MorrisJobke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code makes sense 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants