grpcproxy, etcdmain, integration: add close channel to kv proxy

ccache launches goroutines that need to be explicitly stopped.

Fixes #7158
This commit is contained in:
Anthony Romano
2017-01-13 16:20:09 -08:00
committed by Gyu-Ho Lee
parent 6c8f1986c8
commit c2e8d06eec
5 changed files with 30 additions and 14 deletions

View File

@@ -39,6 +39,7 @@ type Cache interface {
Get(req *pb.RangeRequest) (*pb.RangeResponse, error)
Compact(revision int64)
Invalidate(key []byte, endkey []byte)
Close()
}
// keyFunc returns the key of an request, which is used to look up in the cache for it's caching response.
@@ -58,6 +59,8 @@ func NewCache(maxCacheEntries int) Cache {
}
}
func (c *cache) Close() { c.lru.Stop() }
// cache implements Cache
type cache struct {
mu sync.RWMutex