Skip to content
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

Reconnect with jitter. #2590

Merged
merged 6 commits into from
Jul 30, 2015
Merged

Reconnect with jitter. #2590

merged 6 commits into from
Jul 30, 2015

Conversation

yang-g
Copy link
Member

@yang-g yang-g commented Jul 21, 2015

According to https://github.com/grpc/grpc/blob/master/doc/connection-backoff.md

Sample connect backoff:

retry  1 backoff 1.00s, expected backoff   1.00s, jitter -0.10%
retry  2 backoff 1.59s, expected backoff   1.60s, jitter -0.50%
retry  3 backoff 2.19s, expected backoff   2.56s, jitter -14.61%
retry  4 backoff 3.77s, expected backoff   4.10s, jitter -7.96%
retry  5 backoff 7.38s, expected backoff   6.55s, jitter 12.59%
retry  6 backoff 9.50s, expected backoff  10.49s, jitter -9.37%
retry  7 backoff 19.20s, expected backoff  16.78s, jitter 14.43%
retry  8 backoff 24.45s, expected backoff  26.84s, jitter -8.93%
retry  9 backoff 51.16s, expected backoff  42.95s, jitter 19.11%
retry 10 backoff 61.70s, expected backoff  68.72s, jitter -10.21%
retry 11 backoff 105.03s, expected backoff 109.95s, jitter -4.48%
retry 12 backoff 127.89s, expected backoff 120.00s, jitter 6.58%
retry 13 backoff 108.55s, expected backoff 120.00s, jitter -9.54%
retry 14 backoff 99.28s, expected backoff 120.00s, jitter -17.27%
retry 15 backoff 106.92s, expected backoff 120.00s, jitter -10.90%

@yang-g yang-g added this to the Beta milestone Jul 21, 2015
@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request) and all commit authors, but as best as we can tell these commits were authored by someone else. If that's the case, please add them to this pull request and have them confirm that they're okay with these commits being contributed to Google. If we're mistaken and you did author these commits, just reply here to confirm.

@yang-g
Copy link
Member Author

yang-g commented Jul 21, 2015

This is built on top of #2477 which needs to be merged first.

@googlebot
Copy link

CLAs look good, thanks!

@yang-g
Copy link
Member Author

yang-g commented Jul 29, 2015

This is now ready for review.

@yang-g yang-g assigned vjpai and unassigned ctiller Jul 30, 2015
@@ -125,6 +131,8 @@ struct grpc_subchannel {
int have_alarm;
/** our alarm */
grpc_alarm alarm;
/** current random value */
gpr_int32 random;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

random is used throughout the code as an unsigned, so can you change it to a uint?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@vjpai
Copy link
Member

vjpai commented Jul 30, 2015

Besides my one comment, the code LGTM and I'll wait on the change of random and the appropriate level of green-ness.

@vjpai
Copy link
Member

vjpai commented Jul 30, 2015

I am ready to merge this.

vjpai added a commit that referenced this pull request Jul 30, 2015
@vjpai vjpai merged commit 6765604 into grpc:master Jul 30, 2015
@yang-g yang-g mentioned this pull request Aug 3, 2015
@lock lock bot locked as resolved and limited conversation to collaborators Jan 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants