Explorar o código

Merge pull request #5203 from heyitsanthony/fix-lease-leak

clientv3: check stream context in lease keep alive send loop
Anthony Romano %!s(int64=9) %!d(string=hai) anos
pai
achega
ecb0e2bd38
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      clientv3/lease.go

+ 2 - 0
clientv3/lease.go

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