andrey-usa opened a new issue, #914:
URL: https://github.com/apache/arrow-rs-object-store/issues/914

   **Describe the bug**
   
   `RetryableRequest` retries any 5xx response (`status.is_server_error()`, 
`src/client/retry.rs` around line 428 on `main`, 406-411 in 0.14.2). That 
includes 501 Not Implemented, which RFC 9110 section 15.6.2 defines as "the 
server does not support the functionality required to fulfill the request": the 
same request will get the same answer. With the default `RetryConfig` the 
caller waits through 10 retries with backoff (seconds typically, up to 
`retry_timeout`) before getting the error it could have had at once.
   
   **To Reproduce**
   
   A server or CDN that does not implement a request feature answers 501. For 
example, Fastly answers a suffix range (`Range: bytes=-n`) with 501. Against an 
S3-compatible endpoint that does this, `store.get_opts(path, GetOptions { 
range: Some(GetRange::Suffix(n)), .. })` sends the request 11 times and then 
fails with `... after 10 retries, max_retries: 10, retry_timeout: 180s ... 501 
Not Implemented`.
   
   **Expected behavior**
   
   A 501 is returned to the caller on the first response, without retrying, so 
the caller can fall back (for a suffix range: ask for a bounded range instead).
   
   **Additional context**
   
   - A one-line change in the default predicate would do it: retry 
`is_server_error() && status != StatusCode::NOT_IMPLEMENTED`.
   - #840 / #841 would let a caller override the whole status predicate; this 
is narrower: only the default's handling of 501.
   - Workaround today: wrap the `HttpConnector` and map a 501 response to an 
`HttpError` of kind `Unknown`, which the retry loop does not retry.


-- 
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