`hyper::Error::is_incomplete_message()` classified as `HttpErrorKind::Request`, retrying non idempotent `PutMode::Create`

Open Beginner friendly
#912 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

@hcrosse is already working on this.

Since Nov 21, 2026.

  • #913 by @hcrosse — open

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

  1. Configure an AmazonS3 store with S3ConditionalPut::ETagMatch and RetryConfig (max_retries >= 1) pointing at an HTTP server.
  2. On the first PUT with If-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 second PUT for the same key with If-None-Match: *, return 412 Precondition Failed.
  3. Call store.put_opts(&path, payload, PutOptions::from(PutMode::Create)).await.
  4. Observe that object_store sends a second PUT and returns Error::AlreadyExists instead 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

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/arrow-rs-object-store

All issues in apache/arrow-rs-object-store

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.