Skip to content

fix(s3): Fix improper handle for copy response#7294

Merged
Xuanwo merged 3 commits intoapache:mainfrom
dentiny:hjiang/fix-copy-response-handle
Mar 24, 2026
Merged

fix(s3): Fix improper handle for copy response#7294
Xuanwo merged 3 commits intoapache:mainfrom
dentiny:hjiang/fix-copy-response-handle

Conversation

@dentiny
Copy link
Copy Markdown
Contributor

@dentiny dentiny commented Mar 24, 2026

Which issue does this PR close?

Closes #7293

Rationale for this change

As described in the attached issue, currently we consider 200 OK HTTP status as copy success, but the doc also clarifies the error information could be contained in response body.

What changes are included in this PR?

In this PR, I make a few design decisions:

  • If the response could be parsed to a valid CopyObjectResult (with ETag field present), then we consider it success
  • Otherwise, it's considered as failure; I make it retriable because the copy request has been accepted at server side, it's copy operation failure, likely server internal error, resource exhausted, timeout, etc
    • Doc: If the error occurs before the copy action starts, you receive a standard Amazon S3 error.

Doc here: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html

Are there any user-facing changes?

No

AI Usage Statement

No AI involvement.

@dentiny dentiny requested a review from Xuanwo as a code owner March 24, 2026 10:12
@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. releases-note/fix The PR fixes a bug or has a title that begins with "fix" labels Mar 24, 2026
Copy link
Copy Markdown
Member

@Xuanwo Xuanwo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Mar 24, 2026
@Xuanwo Xuanwo merged commit 22e6731 into apache:main Mar 24, 2026
70 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer releases-note/fix The PR fixes a bug or has a title that begins with "fix" size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: improper error handling for S3 copy operations

2 participants