Repository navigation
Retry interrupted SSH uploads using a fresh connection - #880
Masterwow3 wants to merge 3 commits into
Conversation
m90
left a comment
There was a problem hiding this comment.
Thanks for this. I think this is a nice feature to have, but considering stability, I'd prefer starting with a default value of 0 and letting users opt into this behavior. See the comment inline. Also, there is a linting error in the test.
Let me know if there are any questions.
|
Thanks for the review! Addressed the feedback in a94c676: retries now default to |
|
Thank you once more, I appreciate the thorough tests on top of the feature. This looks good to me, but I'd like to defer releasing it for a week or so so that SSH users can catch up with the required migration from https://github.com/offen/docker-volume-backup/releases/tag/v2.49.2. Otherwise, I'd be afraid the release notes get lost and people are thinking this feature broke their setup. I'll let you know when this is released. |
An SSH/SFTP connection loss during upload currently fails the entire backup run, even when the archive has already been created and the containers have restarted. The keepalive added in #863 helps prevent idle disconnects but does not reconnect after a transport failure.
This change retries the existing archive over a fresh SSH/SFTP connection. Each attempt starts at byte zero and truncates the destination file. It does not recreate the archive or run container lifecycle hooks again.
SSH_UPLOAD_RETRIES(default:2;0disables retries) andSSH_UPLOAD_RETRY_DELAY(default:5s).Validation:
go test ./...go vet ./...GOOS=linux GOARCH=amd64 go build ./...The Docker Compose integration suite was not run because no Docker daemon was available in the development environment. The SSH/SFTP regression test runs as part of the Go test suite without Docker.
Scope: this change does not retry initial backend setup or pruning, retain temporary archives after retries are exhausted, or publish remote files by atomic rename. An exhausted upload can still leave a partial remote file, as before. Existing SSH connection/handshake timeout behavior is unchanged.