object_store: retry on response decoding errors#6519
Conversation
Closes https://github.com/apache/arrow-rs/issues/6287 This PR includes `reqwest::Error::Decode` as an error case to retry on, which can occur when a server drops a connection in the middle of sending the response body.
|
Have you tested this, I ask as the retry logic occurs before the response body processing |
I haven't. My assumption was that this error originates from within the reqwest client, so we should be able to catch it here. Even in the streaming case I thought we should still be polling data from the Testing this is a bit annoying without mocking the inner client, which isn't exactly a real world scenario. I am not very familiar with the existing testing harness so if you have any recommendations on where to start I would appreciate it. |
Unfortunately, more broadly speaking this is not generally possible, as discussed on the ticket. Once response streaming has started, a retry would need to somehow resume from where it left off, the semantics of which will depend on the method in question. I do not know of a good way to handle this.
We already have a mock HTTP server harness for running these sorts of tests |
Could you link me to where this is discussed? I'm afraid there's been a lot of comments around this spread across various issues, so it is hard to find specific discussions.
Is "method" in this context referring to the HTTP method? Perhaps we need a apache/arrow-rs-object-store#53 suggests having a manual way to re-initiate the request, but I'm not sure what that would look like either. |
apache/arrow-rs-object-store#53
I think we could add a method to However, ObjectStore::get will require retrying at a higher level, as not only will it need to keep track of the current offset, but compute a new range for the retry, and re-sign the resulting request. Perhaps something in |
|
In my opinion, to move forward we really need an example/test showing the problem so we can evaluate how the proposed solution fixes it. More discussion here: apache/arrow-rs-object-store#53 |
|
One thing I've noticed is that I also would see failed decoding bytes, when a timeout is set too low. Could it be that the request still gets processed even though it was incomplete and should have thrown a timeout error instead? |
From what I understand, if a request fails mid-stream (after we begin to read data) just retrying the request isn't enough -- instead it would need something more complicated like retrying the request just for the bytes that hadn't been already read, or something like that |
|
Since this keeps coming up, I filed a separate ticket to track |
|
Thank you for this PR. We are in the process of moving the object_store code to its own repository. Would it be possible for you to create a PR in that repository instead?
(we will handle moving all existing issues to the new repository) |
|
We merged a fix in |
Closes apache/arrow-rs-object-store#53
This PR includes
reqwest::Error::Decodeas an error case to retry on, which can occur when a server drops a connection in the middle of sending the response body.