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>
This commit is contained in:
CAOShurong
2026-08-26 14:26:37 +01:00
committed by GitHub
co-authored by Shurong Cao
parent c140d36a1f
commit 660144d311
+10
View File
@@ -4653,6 +4653,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 {