-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Requests Retrying is broken if the error was caused due to a client timeout #947
Comments
Thanks for letting us know about this issue, and example. I think you're correct. This change was added to capture users's canceling a request, ensuring the SDK did not attempt to retry a canceled. request. I think we can add additional logic around this correctly allow retries of Timeout, but not cancels. |
The SDK should be able to take advantage of the net package's Error interface for determining if the request can be retried. https://golang.org/pkg/net/#Error |
Hello @mbh621, I have a PR, #981, out that addresses this issue. Please let us know if you have any more issues! |
* Fixing bug #947 * Updating tests * Updating tests * Refactoring to work with any version * Update request.go
This logic in Request.Send() makes it impossible to retry if a Send handler fails due to a client timeout.
Here's what an error returned by the standard library's
Client.Do()
looks like:I'd expect to be able to retry a request if it failed due to a timeout I set. Here's a unit test I wrote to check this:
Was this intended when support for cancelling HTTP requests was added? (this commit)
The text was updated successfully, but these errors were encountered: