-
Notifications
You must be signed in to change notification settings - Fork 1
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
group client config requests #1395
Conversation
There are still a couple of things that need to be done, such as update the original config fetcher to not fetch proxy configs, have flashlight start the new config and bypass services, add tests, etc. |
dd49bb5
to
148f4f0
Compare
aea2ed1
to
f15ff8f
Compare
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.
Nice work so far @garmr-ulfr!
The config request service utilizes the callRandomly code from bypass that adds jitter between requests to avoid creating a pattern that censors could detect.
Just FYI, another reason is to prevent the thundering herd problem. Probably the more important reason IMO.
services/http.go
Outdated
sleepVal := resp.Header.Get(common.SleepHeader) | ||
if sleepVal != "" { | ||
if sleepTime, err = strconv.ParseInt(sleepVal, 10, 64); err != nil { | ||
logger.Errorf("Could not parse sleep val: %v", err) |
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.
Let's set a default sleep time in this case. How's one hour sound to you?
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.
sleepVal
here is extra sleep time. If we wanted an hour between polls, wouldn't that be PollInterval
?
On that note, if we're generalizing the fetching code, I think we should add exponential back-off on error. Let's max that out at 10 minutes (not including jitter). |
43d7a49
to
6b79958
Compare
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.
The PR looks really good! I've added a small optional suggestion because I'm allergic to goto and labels but it can be ignored!
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. Awesome work @garmr-ulfr!
Let's open a PR into lantern-client with these changes. We'll try to get a build out and prioritize thorough testing.
edc2124
to
727c52a
Compare
There is bug causes the fetch to fail when starting Lantern and there are existing proxy configs with IPs that have rotated out. |
Fixed. |
This groups the proxy, geolocation, and user config requests to reduce start up time. The config request service utilizes the
callRandomly
code frombypass
that adds jitter between requests to prevent the thundering herd problem, as well as avoid creating a pattern that censors could detect.