-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds a new module `janus_core::retries` which uses crate `backoff` to allow retrying HTTP requests based on whether an error is transient. We retry if we encounter: - failures to connect (i.e., connection refused or reset); - timeouts; - HTTP errors in the 500 range, except 501 Not Implemented. The error classification depends on methods on `reqwest::Error` and walking the chain of `std::error::Error::source` errors to see if there is an `std::io::Error` under the covers. We retry on HTTP status 500, 502-599, but if we give up after encountering enough such errors, the caller gets `Err(Ok(reqwest::Response))` so that they can examine the response body or headers. Resolves #196
- Loading branch information
1 parent
8962bdc
commit fd7d8d8
Showing
7 changed files
with
370 additions
and
22 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.