-
Notifications
You must be signed in to change notification settings - Fork 229
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
Fix retry logic #1762
Fix retry logic #1762
Conversation
There was a bit of an oversight in 932e76e The innermost client – _PubHttpClient – throws on bad status codes. These exceptions blow right past the retry logic. My solution – move the check & throw logic into a _ThrowingClient that sits outside of of the retry logic. |
Closes #1556
40e6d3c
to
e995d95
Compare
...at least one test would be a good idea... |
Feel free to squash/merge and delete the branch if approve... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm always a bit reticent to add tests for behavior that involves explicit delays, but if you want to add a test for retrying a single time I wouldn't be opposed.
lib/src/http.dart
Outdated
@@ -216,10 +184,54 @@ final _pubClient = new _PubHttpClient(); | |||
/// we're waiting for them to come back up. | |||
final _retriedHosts = new Set<String>(); | |||
|
|||
class _ThrowingClient extends http.BaseClient { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please document this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PTAL
I'll merge once Travis comes back successful. |
Perfect!
…On Mon, Dec 18, 2017 at 1:46 PM, Natalie Weizenbaum < ***@***.***> wrote:
I'll merge once Travis comes back successful.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1762 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AABCimjAy1tbinyhfFEsf0Vu36QajFr-ks5tBt0mgaJpZM4REPR1>
.
|
Closes #1556