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

etcdserver: make dial timeout longer #8599

Merged
merged 2 commits into from
Sep 23, 2017
Merged

Conversation

xiang90
Copy link
Contributor

@xiang90 xiang90 commented Sep 22, 2017

fix #8532

@xiang90
Copy link
Contributor Author

xiang90 commented Sep 22, 2017

/cc @fanminshi

// + one RTT, which is smaller than 1/5 election timeout
return time.Second + time.Duration(c.ElectionTicks)*time.Duration(c.TickMs)*time.Millisecond/5
// 1s for queue wait and election timeout
return time.Second + time.Duration(c.ElectionTicks)*time.Duration(c.TickMs)*time.Millisecond
Copy link
Member

Choose a reason for hiding this comment

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

I am curious why multiply ElectionTicks and TickMs time.Duration(c.ElectionTicks)*time.Duration(c.TickMs)?

Copy link
Contributor

Choose a reason for hiding this comment

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

Generally looks good to me.

For readability, maybe go with:

time.Duration(c.ElectionTicks * c.TickMs)*time.Millisecond

This way we don't imply c.ElectionTicks is a duration (it's just count right?), until it's multiplied with the milliseconds per tick.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am curious why multiply ElectionTicks and TickMs

to get the duration. ticks is number of ticks. tickMS is duration per key. you can read the code around tick to understand this better.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jpbetz fixed.

@jpbetz
Copy link
Contributor

jpbetz commented Sep 23, 2017

lgtm

@xiang90
Copy link
Contributor Author

xiang90 commented Sep 23, 2017

@jpbetz Thanks for the review. I am going to merge this shortly.

@xiang90 xiang90 merged commit 4830ca7 into etcd-io:master Sep 23, 2017
@xiang90 xiang90 deleted the longer_timeout branch September 23, 2017 23:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

etcd dial timeout too fast when new member can't reach to the existing cluster
4 participants