mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
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:
committed by
Gyu-Ho Lee
parent
6c8f1986c8
commit
c2e8d06eec
3
proxy/grpcproxy/cache/store.go
vendored
3
proxy/grpcproxy/cache/store.go
vendored
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user