`hyper::Error::is_incomplete_message()` classified as `HttpErrorKind::Request`, retrying non idempotent `PutMode::Create`
Maintainers usually reply within 2 days
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 80/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- rust
- Domain
- networking
Research direction
Read HttpError::reqwest in src/client/http/connection.rs (around lines 122-138): the is_incomplete_message() branch sits directly above the UnexpectedEof/ConnectionReset arms that already map to HttpErrorKind::Interrupted, so the fix is to move it into that classification. Then read RetryableRequest::send in src/client/retry.rs (around lines 457-463) to confirm that Interrupted only retries when is_idempotent is true. Done looks like: is_incomplete_message() maps to Interrupted, and a test shows a non-idempotent PutMode::Create failing fast while a repeated PUT is not issued.
Written by the indexing model from the issue text.
Description
Describe the bug
HttpError::reqwest maps hyper::Error::is_incomplete_message() to HttpErrorKind::Request, which RetryableRequest::send unconditionally retries (HttpErrorKind::Connect | HttpErrorKind::Request => true) even when is_idempotent is false.
hyper::Error::is_incomplete_message() fires when the remote peer closes the connection with EOF after the request has already been written on the wire, before or during the response. Unlike std::io::ErrorKind::UnexpectedEof and ConnectionReset right below it in HttpError::reqwest, which map to HttpErrorKind::Interrupted and only retry when is_idempotent is true, is_incomplete_message() retries non idempotent writes such as PutMode::Create (If-None-Match: *) or PutMode::Update.
When a server or proxy commits a PutMode::Create request and then closes the TCP connection without sending response headers, the retry hits 412 Precondition Failed and converts an ambiguous transport failure into a spurious Error::AlreadyExists. Downstream table formats that rely on PutMode::Create for atomic commits can misinterpret that AlreadyExists as a concurrent writer commit and either duplicate writes or fail an already committed transaction.
To Reproduce
- Configure an
AmazonS3store withS3ConditionalPut::ETagMatchandRetryConfig(max_retries >= 1) pointing at an HTTP server. - On the first
PUTwithIf-None-Match: *, read the full request headers and body, record the object as committed, and drop the TCP stream cleanly without writing a response. On a secondPUTfor the same key withIf-None-Match: *, return412 Precondition Failed. - Call
store.put_opts(&path, payload, PutOptions::from(PutMode::Create)).await. - Observe that
object_storesends a secondPUTand returnsError::AlreadyExistsinstead of returning the transport error from the first attempt.
Expected behavior
hyper::Error::is_incomplete_message() should be classified as HttpErrorKind::Interrupted, matching std::io::ErrorKind::UnexpectedEof and ConnectionReset. Safe methods (GET, HEAD) and explicitly idempotent writes (PutMode::Overwrite) continue to retry, while non idempotent writes (PutMode::Create, PutMode::Update) fail fast with HttpErrorKind::Interrupted rather than retrying after an ambiguous connection close.
Additional context
This reproduces on main (0.14.2).
- Dominant language
- Rust
- Stars
- 339
- Forks
- 240
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 3
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/arrow-rs-object-store
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
apache/arrow-rs-object-store#914 ·
Maintainers usually reply within 2 days
-
Default `ObjectStore::get_ranges` panics when a range past the end of the object is coalesced with an earlier rangePossibly taken @0z5a claimed this 9 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
apache/arrow-rs-object-store#905 ·
Maintainers usually reply within 2 days
-
AWS: list requests are signed without ClientOptions default headers (sent unsigned, S3 403 HeadersNotSigned)Possibly taken @filippoGRiva claimed this 8 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
apache/arrow-rs-object-store#877 ·
Maintainers usually reply within 2 days
-
List requests do not map HTTP status codes to error variants, so 403 and 404 both become `Error::Generic`May be free again A pull request for this issue was closed without being merged. Open
Difficulty 2/5 Half a day Newbie friendliness 82/100
apache/arrow-rs-object-store#851 · 2 comments · 1 reaction ·
Maintainers usually reply within 2 days
-
Errors on 200 Response for entire-object range requestMay be free again A pull request for this issue was closed without being merged. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
apache/arrow-rs-object-store#806 · 2 comments ·
Maintainers usually reply within 2 days
All issues in apache/arrow-rs-object-store
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
kashsuks/Pinel#172 · 1 comment ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
Maintainers usually reply within 1 day
-
test_a_503_raises_unavailable_error fails on macOS about one run in sixPossibly taken @naman-modi claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
bug ui
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
userFRM/egui-charts#4168 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
Maintainers usually reply within 1 day