소스 검색

Merge pull request #6947 from heyitsanthony/grpc-stat-race

grpcproxy: lock store when getting size
Anthony Romano 9 년 전
부모
커밋
2509e7ad2c
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  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()
 }