-
Notifications
You must be signed in to change notification settings - Fork 792
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
object_store: retry on response decoding errors #6519
base: master
Are you sure you want to change the base?
object_store: retry on response decoding errors #6519
Conversation
Closes apache#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 #6287 suggests having a manual way to re-initiate the request, but I'm not sure what that would look like either. |
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: #6287 (comment) |
Closes #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.