From 631d9d83b6dea0642101b24a0d95ea1ad39a08f4 Mon Sep 17 00:00:00 2001 From: Denis Kirillov Date: Wed, 16 Aug 2023 15:54:47 +0300 Subject: [PATCH] [#185] Fix payload reader When we use io.CopyBuffer it check for exact io.EOF matching, so we need keep original EOF error otherwise io.CopyBuffer returns error Signed-off-by: Denis Kirillov --- internal/frostfs/frostfs.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/frostfs/frostfs.go b/internal/frostfs/frostfs.go index 29e2d423..ba66be80 100644 --- a/internal/frostfs/frostfs.go +++ b/internal/frostfs/frostfs.go @@ -263,6 +263,9 @@ type payloadReader struct { func (x payloadReader) Read(p []byte) (int, error) { n, err := x.ReadCloser.Read(p) + if err != nil && errors.Is(err, io.EOF) { + return n, err + } return n, handleObjectError("read payload", err) }