From 506d92e87c31ac71fb826a308e5b9e67ed57eb9f Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Tue, 23 Aug 2022 22:05:04 +0200 Subject: [PATCH] rclone: Return a permanent error if rclone already exited rclone can exit early for example when the connection to rclone is relayed for example via ssh: `-o rclone.program='ssh user@example.org forced-command'` --- internal/backend/rclone/backend.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/backend/rclone/backend.go b/internal/backend/rclone/backend.go index 0f367fe01..cccc52384 100644 --- a/internal/backend/rclone/backend.go +++ b/internal/backend/rclone/backend.go @@ -15,6 +15,7 @@ import ( "sync" "time" + "github.com/cenkalti/backoff/v4" "github.com/restic/restic/internal/backend" "github.com/restic/restic/internal/backend/limiter" "github.com/restic/restic/internal/backend/rest" @@ -174,7 +175,7 @@ func newBackend(cfg Config, lim limiter.Limiter) (*Backend, error) { debug.Log("new connection requested, %v %v", network, address) if dialCount > 0 { // the connection to the child process is already closed - return nil, errors.New("rclone stdio connection already closed") + return nil, backoff.Permanent(errors.New("rclone stdio connection already closed")) } dialCount++ return conn, nil