Skip to content

Commit

Permalink
Merge pull request #30335 from rjsadow/race-fix
Browse files Browse the repository at this point in the history
fix: lru race condition
  • Loading branch information
k8s-ci-robot authored Aug 9, 2023
2 parents a410d7b + 5bc424c commit b1472a3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions prow/config/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ func NewInRepoConfigCache(
seenOrgRepos := make(map[OrgRepo]int)

cacheSizeMetrics := func() {
lruCache.Mutex.Lock() // Lock the mutex
defer lruCache.Mutex.Unlock() // Unlock the mutex when done
// Record all unique orgRepo combinations we've seen so far.
for _, key := range lruCache.Keys() {
org, repo, err := keyToOrgRepo(key)
Expand Down

0 comments on commit b1472a3

Please sign in to comment.