Merge pull request #7276 from fanminshi/fix_lease_keep_alive_loop

clientv3: sends keepalive reqs immediately after lease keep alive stream reset
This commit is contained in:
Xiang Li 2017-02-04 21:28:56 -08:00 committed by GitHub
commit 6fb99a8585

View File

@ -452,16 +452,6 @@ func (l *lessor) deadlineLoop() {
// sendKeepAliveLoop sends LeaseKeepAliveRequests for the lifetime of a lease stream
func (l *lessor) sendKeepAliveLoop(stream pb.Lease_LeaseKeepAliveClient) {
for {
select {
case <-time.After(500 * time.Millisecond):
case <-stream.Context().Done():
return
case <-l.donec:
return
case <-l.stopCtx.Done():
return
}
var tosend []LeaseID
now := time.Now()
@ -480,6 +470,16 @@ func (l *lessor) sendKeepAliveLoop(stream pb.Lease_LeaseKeepAliveClient) {
return
}
}
select {
case <-time.After(500 * time.Millisecond):
case <-stream.Context().Done():
return
case <-l.donec:
return
case <-l.stopCtx.Done():
return
}
}
}