Browse Source

grpcproxy: lock store when getting size

Fixes data race in proxy integration tests.
Anthony Romano 9 years ago
parent
commit
62398954e4
1 changed files with 2 additions and 0 deletions
  1. 2 0
      proxy/grpcproxy/cache/store.go

+ 2 - 0
proxy/grpcproxy/cache/store.go

@@ -157,5 +157,7 @@ func (c *cache) Compact(revision int64) {
 }
 
 func (c *cache) Size() int {
+	c.mu.RLock()
+	defer c.mu.RUnlock()
 	return c.lru.Len()
 }