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

clientv3: fix lease keepalive duration #7338

Merged
merged 1 commit into from
Feb 16, 2017
Merged

Conversation

xiang90
Copy link
Contributor

@xiang90 xiang90 commented Feb 16, 2017

Fix #7323

@@ -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)
Copy link
Member

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)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

will fix.

@gyuho
Copy link
Contributor

gyuho commented Feb 16, 2017

lgtm.
Should we backport this?

/cc @heyitsanthony @fanminshi

@xiang90
Copy link
Contributor Author

xiang90 commented Feb 16, 2017

@fanminshi ptal

@fanminshi
Copy link
Member

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)
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

even better. changing.

@heyitsanthony
Copy link
Contributor

lgtm

@xiang90 xiang90 merged commit 5d3597a into etcd-io:master Feb 16, 2017
@xiang90 xiang90 deleted the fix_l branch February 16, 2017 19:58
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.

4 participants