hdfs: retry the io.Copy to see if that helps FIXME DO NOT MERGE

This commit is contained in:
Nick Craig-Wood 2024-06-15 17:34:49 +01:00
parent 010ed973df
commit 656ef8952f

View File

@ -142,7 +142,13 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, op
}
}
_, err = io.Copy(out, in)
err = o.fs.pacer.Call(func() (bool, error) {
_, err = io.Copy(out, in)
if err == nil {
return false, nil
}
return errors.Is(err, io.ErrUnexpectedEOF), err
})
if err != nil {
fs.Errorf(o, "update: io.Copy returned error: %v", err)
cleanup()