-
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
clientv3: fix lease keepalive duration #7338
Conversation
clientv3/lease.go
Outdated
@@ -416,7 +416,7 @@ func (l *lessor) recvKeepAlive(resp *pb.LeaseKeepAliveResponse) { | |||
} | |||
|
|||
// send update to all channels | |||
nextKeepAlive := time.Now().Add(1 + time.Duration(karesp.TTL/3)*time.Second) | |||
nextKeepAlive := time.Now().Add(1*time.Second + time.Duration(karesp.TTL/3)*time.Second) |
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 wonder why not time.Now().Add(time.Duration(karesp.TTL/3 + 1)*time.Second)
?
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.
will fix.
lgtm. |
@fanminshi ptal |
lgtm |
@@ -416,7 +416,7 @@ func (l *lessor) recvKeepAlive(resp *pb.LeaseKeepAliveResponse) { | |||
} | |||
|
|||
// send update to all channels | |||
nextKeepAlive := time.Now().Add(1 + time.Duration(karesp.TTL/3)*time.Second) | |||
nextKeepAlive := time.Now().Add(time.Duration(karesp.TTL/3+1) * time.Second) |
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 think this should round instead, (karesp.TTL+2)/3
?
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.
even better. changing.
lgtm |
Fix #7323