hcrosse opened a new pull request, #921: URL: https://github.com/apache/arrow-rs-object-store/pull/921
# Which issue does this PR close? Closes #919. # Rationale for this change Raw substring matching in `body_contains_error` breaks valid S3 keys containing `InternalError` or `SlowDown` on `CompleteMultipartUpload` and `DeleteObjects`. At the same time, `copy_opts` discards HTTP 200 bodies, so any other HTTP 200 `<Error>` code or truncated response silently returns `Ok(())`. # What changes are included in this PR? - Replace `body_contains_error` in [`src/client/retry.rs`](https://github.com/apache/arrow-rs-object-store/blob/main/src/client/retry.rs#L267) with XML root inspection via `quick_xml::Reader`. Only documents whose root element is `<Error>` are treated as errors, retrying transient codes (`InternalError`, `SlowDown`, `ServiceUnavailable`, `RequestTimeout`) or truncated `<Error>` streams and failing immediately on other codes. - Add `validate_copy_response` in [`src/aws/client.rs`](https://github.com/apache/arrow-rs-object-store/blob/main/src/aws/client.rs) and call it from `AmazonS3::copy_opts` to require a valid `<CopyObjectResult>` root XML document without requiring `<ETag>`. - Enable `retry_error_body(true)` on `UploadPartCopy` (`PutPartPayload::Copy`) in `S3Client::put_part`. - Add unit and mock server tests in `src/client/retry.rs` and `src/aws/client.rs`. # Are there any user-facing changes? No public API changes. Non compliant S3 proxies that return empty or non XML HTTP 200 bodies for `CopyObject` will now return an error instead of `Ok(())`. -- 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]
