mirror of
https://github.com/restic/restic.git
synced 2026-02-03 12:29:37 -05:00
Merge pull request #5602 from MichaelEischer/fix-flaky-rclone-test
rclone: fix rare test failure if rclone cannot be started
This commit is contained in:
commit
132f2f8a23
1 changed files with 8 additions and 1 deletions
|
|
@ -12,6 +12,7 @@ import (
|
|||
"net/url"
|
||||
"os"
|
||||
"os/exec"
|
||||
"strings"
|
||||
"sync"
|
||||
"syscall"
|
||||
"time"
|
||||
|
|
@ -245,7 +246,13 @@ func newBackend(ctx context.Context, cfg Config, lim limiter.Limiter, errorLog f
|
|||
// wait for rclone to exit
|
||||
wg.Wait()
|
||||
// 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) || errors.Is(err, os.ErrClosed)) {
|
||||
if be.waitResult != nil &&
|
||||
(errors.Is(err, context.Canceled) ||
|
||||
errors.Is(err, io.ErrUnexpectedEOF) ||
|
||||
errors.Is(err, syscall.EPIPE) ||
|
||||
errors.Is(err, os.ErrClosed) ||
|
||||
// there's unfortunately no better way to check for this error
|
||||
strings.Contains(err.Error(), "http2: client conn could not be established")) {
|
||||
err = be.waitResult
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue