hcrosse opened a new pull request, #8585:
URL: https://github.com/apache/opendal/pull/8585

   # Which issue does this PR close?
   
   Related to #8584.
   
   # Rationale for this change
   
   
[`parse_s3_error_code`](https://github.com/apache/opendal/blob/e60a63f6add87c13bce20e24675f03cdfcba1b6d/core/services/s3/src/core.rs#L2267-L2324)
 has two gaps on `CompleteMultipartUpload` relative to [RFC 
8145](https://github.com/apache/opendal/blob/e60a63f6add87c13bce20e24675f03cdfcba1b6d/core/core/src/docs/rfcs/8145_conflict_error_kind.md#L122-L155):
   
   - `OperationAborted` is marked temporary for every S3 operation, including 
`CompleteMultipartUpload`, even though `Writer::close` and `Copier::close` 
cannot restart a multipart upload session. `ConditionalRequestConflict` already 
treats `CompleteMultipartUpload` as permanent.
   - `NoSuchUpload` has no explicit code mapping and falls back to HTTP 404 
`ErrorKind::NotFound`. When `if_match` is set, 
[`S3Writer::complete_part`](https://github.com/apache/opendal/blob/e60a63f6add87c13bce20e24675f03cdfcba1b6d/core/services/s3/src/writer.rs#L296-L323)
 and 
[`S3Copier::complete_copy`](https://github.com/apache/opendal/blob/e60a63f6add87c13bce20e24675f03cdfcba1b6d/core/services/s3/src/copier.rs#L373-L408)
 rewrite any `NotFound` into `ErrorKind::ConditionNotMatch`, misclassifying an 
expired, aborted, or already completed upload session as a missing target 
object.
   
   # What changes are included in this PR?
   
   - Map `NoSuchUpload` in 
[`parse_s3_error_code`](https://github.com/apache/opendal/blob/e60a63f6add87c13bce20e24675f03cdfcba1b6d/core/services/s3/src/core.rs#L2267-L2324)
 to permanent `ErrorKind::Unexpected` so HTTP 404 and 200 XML `NoSuchUpload` 
responses never map to `NotFound` or `ConditionNotMatch`, while `NoSuchKey` 
under `if_match` continues to return `ConditionNotMatch`.
   - Mark `OperationAborted` permanent when `service_operation` is 
`CompleteMultipartUpload`, keeping it temporary for other operations such as 
`PutObject`.
   - Add parser unit tests and mock HTTP transport tests covering multipart 
write and multipart copy with `if_match` for `NoSuchUpload`, `NoSuchKey`, and 
`OperationAborted` across HTTP status errors and 200 XML responses.
   
   # Are there any user-facing changes?
   
   Yes. For S3 multipart operations, `NoSuchUpload` returns permanent 
`ErrorKind::Unexpected` instead of `ErrorKind::NotFound` or 
`ErrorKind::ConditionNotMatch` under `if_match`, and `OperationAborted` on 
`CompleteMultipartUpload` is permanent `ErrorKind::Conflict` so `RetryLayer` 
does not replay it.
   
   # Breaking changes
   
   # AI Usage Statement
   
   - Harness: OpenCode
   - Model: Gemini 4 Neon / GPT 6.1 Sol / Claude Opus 5.5
   - Effort: default / high (design review)
   - Role: Traced the S3 error classification path against RFC 8145, drafted 
the `parse_s3_error_code` change and mock transport unit tests, and reviewed 
the diff. Validation used `opendal-service-s3` unit tests with a mock HTTP 
transport rather than a live S3 bucket.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to