2
2
mirror of https://github.com/octoleo/restic.git synced 2024-11-22 21:05:10 +00:00

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'`
This commit is contained in:
Michael Eischer 2022-08-23 22:05:04 +02:00
parent 9cdc8da10f
commit 506d92e87c

View File

@ -15,6 +15,7 @@ import (
"sync" "sync"
"time" "time"
"github.com/cenkalti/backoff/v4"
"github.com/restic/restic/internal/backend" "github.com/restic/restic/internal/backend"
"github.com/restic/restic/internal/backend/limiter" "github.com/restic/restic/internal/backend/limiter"
"github.com/restic/restic/internal/backend/rest" "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) debug.Log("new connection requested, %v %v", network, address)
if dialCount > 0 { if dialCount > 0 {
// the connection to the child process is already closed // 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++ dialCount++
return conn, nil return conn, nil