fix(volume-backups): restart container before S3 upload in volume backup#4001
Merged
Siumauricio merged 3 commits intoDokploy:canaryfrom Mar 17, 2026
Merged
Conversation
Siumauricio
requested changes
Mar 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When using volume backup with "Turn Off Container During Backup" enabled, the container was kept stopped for the entire duration of the backup process — including the S3 upload phase. For large volumes, this caused unnecessary downtime proportional to the upload duration. (Fix issue #4000)
Changes
Split
baseCommandinto two distinct commands:backupCommand— creates the tar archiveuploadCommand— uploads to S3 and cleans up the local fileIn the
turnOffflow, the container is now restarted immediately afterbackupCommandcompletes, beforeuploadCommandruns. The container no longer needs to be stopped during the S3 upload since rclone reads only from the local tar file.Before
After
Testing
Testing
Greptile Summary
This PR reduces container downtime during volume backups when "Turn Off Container During Backup" is enabled. Previously, the container remained stopped for the entire backup process — including the S3 upload phase. Now, by splitting the monolithic
baseCommandintobackupCommand(tar creation) anduploadCommand(S3 upload + cleanup), the container is restarted immediately after the tar archive is created on the host filesystem, before the potentially slow S3 upload begins. Since rclone reads from the local tar file (not from inside the container), this reordering is safe.turnOffcode paths: application (Docker Swarm service), compose stack, and docker-composeturnOffpath preserves identical behavior by concatenating both commands sequentiallyturnOffpath, the container is now already running — an improvement over the previous behavior where it would remain stoppedConfidence Score: 4/5
backupCommandanduploadCommandeach containset -e, which is benign but slightly redundant when nested insidelockWrapperwhich also sets it.Last reviewed commit: 2f37235
(2/5) Greptile learns from your feedback when you react with thumbs up/down!