mirror of
https://github.com/octoleo/restic.git
synced 2024-11-25 22:27:35 +00:00
rclone: treat "file already closed" as command startup error
Since #3940 the rclone backend returns the commands exit code if it fails to start. The list of expected errors was missing the "file already closed"-error which can occur if the http test request first learns about the closed pipe to rclone before noticing the canceled context. Go internally makes sure that a file descriptor is unusable once it was closed, thus this cannot have unintended side effects (like accidentally reading from the wrong file due to a reused file descriptor).
This commit is contained in:
parent
fa20a78bb6
commit
f3d964a8c1
@ -239,7 +239,7 @@ func newBackend(cfg Config, lim limiter.Limiter) (*Backend, error) {
|
|||||||
// wait for rclone to exit
|
// wait for rclone to exit
|
||||||
wg.Wait()
|
wg.Wait()
|
||||||
// try to return the program exit code if communication with rclone has failed
|
// try to return the program exit code if communication with rclone has failed
|
||||||
if be.waitResult != nil && (errors.Is(err, context.Canceled) || errors.Is(err, io.ErrUnexpectedEOF) || errors.Is(err, syscall.EPIPE)) {
|
if be.waitResult != nil && (errors.Is(err, context.Canceled) || errors.Is(err, io.ErrUnexpectedEOF) || errors.Is(err, syscall.EPIPE) || errors.Is(err, os.ErrClosed)) {
|
||||||
err = be.waitResult
|
err = be.waitResult
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user