operations: make reopen code error on NoLowLevelRetry errors - fixes #3777
This commit is contained in:
parent
684dbe0e9d
commit
4537d9b5cf
1 changed files with 2 additions and 1 deletions
|
@ -7,6 +7,7 @@ import (
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"github.com/rclone/rclone/fs"
|
"github.com/rclone/rclone/fs"
|
||||||
|
"github.com/rclone/rclone/fs/fserrors"
|
||||||
)
|
)
|
||||||
|
|
||||||
// reOpen is a wrapper for an object reader which reopens the stream on error
|
// reOpen is a wrapper for an object reader which reopens the stream on error
|
||||||
|
@ -104,7 +105,7 @@ func (h *reOpen) Read(p []byte) (n int, err error) {
|
||||||
h.err = err
|
h.err = err
|
||||||
}
|
}
|
||||||
h.read += int64(n)
|
h.read += int64(n)
|
||||||
if err != nil && err != io.EOF {
|
if err != nil && err != io.EOF && !fserrors.IsNoLowLevelRetryError(err) {
|
||||||
// close underlying stream
|
// close underlying stream
|
||||||
h.opened = false
|
h.opened = false
|
||||||
_ = h.rc.Close()
|
_ = h.rc.Close()
|
||||||
|
|
Loading…
Reference in a new issue