grpcproxy: don't wait for ctx.Done() to close kv donec

Causes a goroutine leak in ActiveConnection.Close() tests. Channel is
vestigial since removing ccache; revisit if kv ever needs goroutines.
This commit is contained in:
Anthony Romano 2017-02-14 16:46:01 -08:00
parent 49a0a63fc3
commit 36f5b713bf

View File

@ -33,11 +33,7 @@ func NewKvProxy(c *clientv3.Client) (pb.KVServer, <-chan struct{}) {
cache: cache.NewCache(cache.DefaultMaxEntries),
}
donec := make(chan struct{})
go func() {
defer close(donec)
<-c.Ctx().Done()
kv.cache.Close()
}()
close(donec)
return kv, donec
}