clientv3: check stream context in lease keep alive send loop

If no leases are being kept alive, a connection reset would leak
the send routine since it would only test the stream when sending
keep alives.

Fixes #5200
This commit is contained in:
Anthony Romano
2016-04-26 20:10:09 -07:00
parent d923b59190
commit 30a9229f38

View File

@@ -351,6 +351,8 @@ 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():