Skip to content

Commit

Permalink
Merge pull request moby#4010 from alexcb/acb/contenthash-race
Browse files Browse the repository at this point in the history
contenthash: data race
  • Loading branch information
tonistiigi authored Jul 12, 2023
2 parents 31a9120 + caa9579 commit 0eafef8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cache/contenthash/checksum.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,9 @@ func (cm *cacheManager) GetCacheContext(ctx context.Context, md cache.RefMetadat
cm.lruMu.Unlock()
if ok {
cm.locker.Unlock(md.ID())
v.(*cacheContext).mu.Lock() // locking is required because multiple ImmutableRefs can reach this code; however none of them use the linkMap.
v.(*cacheContext).linkMap = map[string][][]byte{}
v.(*cacheContext).mu.Unlock()
return v.(*cacheContext), nil
}
cc, err := newCacheContext(md)
Expand Down

0 comments on commit 0eafef8

Please sign in to comment.