Adjust Backup task workflow

Summary: When running the backup task, if there's an error while uploading to remote storage then the backup dir is getting cluttered up

Steps to reproduce: run the backup task with an upload job that fails somewhere

Expected behavior: Backup task finishes up cleanup and remove of old backups before trying to upload

Observed behavior: Backup task is uploading, then gets an error while uploading, leaving the temp files and the old backups in the folder, resulting in the HDD getting full pretty quick on a daily task

Relevant logs and/or screenshots:

Output of checks: Not relevant for this as it's not an gitlab error but a simple logic issue.

Possible fixes:

Move line https://gitlab.com/gitlab-org/gitlab-ce/blob/master/lib/backup/manager.rb#L29 after https://gitlab.com/gitlab-org/gitlab-ce/blob/master/lib/tasks/gitlab/backup.rake#L18

Add a simple return tar_file to manager.rb where the line was to catch it on the rake task (or make tar_file a class variable and make upload's argument optional)

Edited Sep 02, 2020 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading