operations: fall back when source ignores ranges

When a multi-thread source ignores ranged reads, abort the partial
destination and retry the copy as a single stream. Reset accounting
before the fallback so transfer progress remains accurate.
This commit is contained in:
Morax
2026-08-14 18:40:40 +02:00
committed by Nick Craig-Wood
parent 1003280bb1
commit 9f93da3299
2 changed files with 50 additions and 1 deletions
+6 -1
View File
@@ -266,7 +266,12 @@ func (c *copy) manualCopy(ctx context.Context) (actionTaken string, newDst fs.Ob
}
if doMultiThreadCopy(ctx, c.f, c.src) {
return c.multiThreadCopy(ctx, uploadOptions)
actionTaken, newDst, err = c.multiThreadCopy(ctx, uploadOptions)
if !errors.Is(err, fs.ErrorRangeIgnored) {
return actionTaken, newDst, err
}
fs.Logf(c.src, "multi-thread copy: %v: downloading in a single stream", err)
c.tr.Reset(ctx)
}
var in io.ReadCloser