forked from TrueCloudLab/restic
Don't retry when "Permission denied" occurs in local backend
This commit is contained in:
parent
f7c7c2f730
commit
7dab113035
2 changed files with 6 additions and 5 deletions
|
@ -5,8 +5,10 @@ restic retries the failing operation up to nine times (for a total of ten
|
||||||
attempts). It used to retry all backend operations, but now detects some
|
attempts). It used to retry all backend operations, but now detects some
|
||||||
permanent error conditions so it can report fatal errors earlier.
|
permanent error conditions so it can report fatal errors earlier.
|
||||||
|
|
||||||
Permanent failures include local disks being full and SSH connections
|
Permanent failures include local disks being full, SSH connections
|
||||||
dropping.
|
dropping and permission errors.
|
||||||
|
|
||||||
https://github.com/restic/restic/issues/2453
|
https://github.com/restic/restic/issues/2453
|
||||||
https://github.com/restic/restic/pull/3170
|
https://github.com/restic/restic/pull/3170
|
||||||
|
https://github.com/restic/restic/issues/3180
|
||||||
|
https://github.com/restic/restic/pull/3181
|
||||||
|
|
|
@ -91,9 +91,8 @@ func (b *Local) Save(ctx context.Context, h restic.Handle, rd restic.RewindReade
|
||||||
filename := b.Filename(h)
|
filename := b.Filename(h)
|
||||||
|
|
||||||
defer func() {
|
defer func() {
|
||||||
// Mark non-retriable errors as such (currently only
|
// Mark non-retriable errors as such
|
||||||
// "no space left on device").
|
if errors.Is(err, syscall.ENOSPC) || os.IsPermission(err) {
|
||||||
if errors.Is(err, syscall.ENOSPC) {
|
|
||||||
err = backoff.Permanent(err)
|
err = backoff.Permanent(err)
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
Loading…
Reference in a new issue