From 30a9229f38fbdf91d5a058c97dd3de05e4e162d2 Mon Sep 17 00:00:00 2001 From: Anthony Romano Date: Tue, 26 Apr 2016 20:10:09 -0700 Subject: [PATCH] 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 --- clientv3/lease.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/clientv3/lease.go b/clientv3/lease.go index 00873b02d..104cce03f 100644 --- a/clientv3/lease.go +++ b/clientv3/lease.go @@ -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():