Add backoff to stream reconnect#62
Merged
Merged
Conversation
drichelson
commented
Nov 2, 2016
| events_uri='https://events.launchdarkly.com', | ||
| connect_timeout=2, | ||
| read_timeout=10, | ||
| connect_timeout=10, |
Contributor
Author
There was a problem hiding this comment.
These were lower than what we've seen in the field (5 seconds just for dns lookup) so I'm upping them here.
drichelson
commented
Nov 2, 2016
| update_processor_ready.wait(start_wait) | ||
|
|
||
| if self._update_processor.initialized: | ||
| if self._update_processor.initialized() is True: |
Contributor
Author
There was a problem hiding this comment.
This was not evaluating correctly.. it would indicate success even when the streaming processor had not been initialized.
drichelson
commented
Nov 2, 2016
| if message_ok is True and self._ready.is_set() is False: | ||
| self._ready.set() | ||
| except HTTPError as e: | ||
| if e.response is not None and e.response.status_code is not None: |
Contributor
Author
There was a problem hiding this comment.
We now stop the reconnect loop if a 4xx response code is seen.
Contributor
Author
There was a problem hiding this comment.
which begs the question- is it possible for a 404 error to be transient? due to a misconfigured/misbehaving CDN?
Contributor
|
This definitely looks good. It might also be worth not retrying at all when we get a status in the 4xx range, since retrying the same request should result in the same status. |
pkaeding
approved these changes
Nov 3, 2016
eli-darkly
added a commit
that referenced
this pull request
Jun 19, 2018
remove unused CacheControl package
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Initial changes to initialization. This attempts to address the fact that we aggressively retry streaming connections. There are other improvements to make, but this one is bite-sized and has other corrections as well.
We're also now properly reporting that the client is initialized or not.