Skip to content

Commit

Permalink
clientv3: do not set next keepalive time <= now+TTL
Browse files Browse the repository at this point in the history
  • Loading branch information
Anthony Romano committed Feb 21, 2017
1 parent 0c0fbbd commit 3c306cd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion clientv3/lease.go
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ func (l *lessor) recvKeepAlive(resp *pb.LeaseKeepAliveResponse) {
}

// send update to all channels
nextKeepAlive := time.Now().Add(time.Duration(karesp.TTL+2) / 3 * time.Second)
nextKeepAlive := time.Now().Add((time.Duration(karesp.TTL) * time.Second) / 3.0)
ka.deadline = time.Now().Add(time.Duration(karesp.TTL) * time.Second)
for _, ch := range ka.chs {
select {
Expand Down

0 comments on commit 3c306cd

Please sign in to comment.