-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
Conversation
4f3a42f
to
2303232
Compare
/cc @fanminshi |
etcdserver/config.go
Outdated
// + 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 |
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.
I am curious why multiply ElectionTicks
and TickMs
time.Duration(c.ElectionTicks)*time.Duration(c.TickMs)
?
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.
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.
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.
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.
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.
@jpbetz fixed.
lgtm |
44f3686
to
35e2856
Compare
@jpbetz Thanks for the review. I am going to merge this shortly. |
fix #8532