-
-
Notifications
You must be signed in to change notification settings - Fork 844
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
Retries for connection failures #784
Conversation
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.
This is great, thanks @florimondmanca 🌟
Just a minor code style issue but otherwise LGTM
Thanks for the reviews, @yeraydiazdiaz and @tomchristie! Addressed in the latest commits. Let me know what you think about these. :-) |
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.
LGTM, nice job!
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.
Seems pretty fantastic, yup!
One question: should we consider using private method names on the class?
(Given that we might have a public API there at some point, it aren’t ready to commit to one yet)
Well, we could, but then we'd need to have the client call into those private methods… I suppose not documenting |
Stuff to consider as follow-ups:
|
@tomchristie I marked #782 and #785 as pending for v0.12. This one seems ready to be merged, so should we have it in for v0.12 as well? |
a5fcdfc
to
c435bde
Compare
How is this looking for 0.12.0? Looks like some conflicts now because of the private name switch, but I tested a merge and it goes cleanly aside from that. If it gets merged and I have time this weekend, I may attempt to build on it for status code retries. |
@StephenBrown2 Personally I’d be happy to consider it for 0.12. The features so far are restricted in scope which is definitely a good thing... Though I’m still undecided on whether this should eventually be handled by a third-party package, if/when a middleware API such as in #783 is added. That’s why I might be tempted to mark this as « provisional », at least. |
So, this is looking great! There's one implementation-level bit that we might want to consider?... Adding That conflicts slightly with #768 which drops backends into being a strictly dispatcher-only bit of implementation, and with the intent of #782, which removes Something that we could consider here is treating We could use that in the async case, and use the regular |
Possibly OT question: does this handle server sending a GOAWAY frame in response to starting a new stream? |
Closing this off as this is super stale now - lots of conflicts I'm not sure are easily resolvable. If we figure connection retries are something we'd want to have built in, it should be fairly easy to start off from this diff to create a fresh branch from |
code restored from encode#784
A simpler version of #778.
Still TODO:
retries=...
to the top-level API.retries=...
Note:
dispatcher
there, and adding fail-until-some-number-of-retries on the uvicorn server isn't straight-forward at all…You can try this out with…
$ python example.py
Example log output:
For a sync client (had to make a few tweaks to our
Urllib3Dispatcher
here):