Merge pull request #16204 from kensou97/release-3.5

[3.5] clientv3: create keepAliveCtxCloser goroutine only if ctx can be canc…
This commit is contained in:
Benjamin Wang 2023-07-14 13:46:38 +01:00 committed by GitHub
commit c7d9708387
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -294,7 +294,9 @@ func (l *lessor) KeepAlive(ctx context.Context, id LeaseID) (<-chan *LeaseKeepAl
}
l.mu.Unlock()
go l.keepAliveCtxCloser(ctx, id, ka.donec)
if ctx.Done() != nil {
go l.keepAliveCtxCloser(ctx, id, ka.donec)
}
l.firstKeepAliveOnce.Do(func() {
go l.recvKeepAliveLoop()
go l.deadlineLoop()