s3: treat UploadPart success without ETag as retryable error
A successful UploadPart whose response carries no ETag header made
WriteChunk panic dereferencing uout.ETag in a debug log line. The part
ETag is required by CompleteMultipartUpload, so an ETag-less 200 is
unusable: return a retryable error from inside the pacer callback so
the chunk is retried instead of crashing the transfer or completing
the upload with a broken part list.
Fixes #9822
Co-authored-by: Shurong Cao <170531907+CAOShurong@users.noreply.github.com>
(cherry picked from commit 660144d311)
This commit is contained in:
1 parent
5a490a31c5
commit
6317faccc0
1 file changed
+10
@@ -4657,6 +4657,16 @@ func (w *s3ChunkWriter) WriteChunk(ctx context.Context, chunkNumber int, reader
|
||||
// retry all chunks once have done the first few
|
||||
return true, err
|
||||
}
|
||||
if uout == nil || uout.ETag == nil {
|
||||
// A successful UploadPart without an ETag header is unusable: the
|
||||
// part ETag is required by CompleteMultipartUpload. Proxies and
|
||||
// load balancers have been observed emitting empty 200 responses
|
||||
// under load - see #9822. Treat it as a retryable error so the
|
||||
// pacer retries this chunk, instead of dereferencing a nil ETag
|
||||
// in the debug log below or completing the upload with a broken
|
||||
// part list.
|
||||
return true, fmt.Errorf("UploadPart response for chunk %d has no ETag", chunkNumber+1)
|
||||
}
|
||||
return false, nil
|
||||
})
|
||||
if err != nil {
|
||||
|
||||
Reference in new issue
Block a user