Skip to content

Commit

Permalink
Add a mutex to map writing when using KOCACHE (#580)
Browse files Browse the repository at this point in the history
  • Loading branch information
imjasonh authored Feb 2, 2022
1 parent e961890 commit 1425e4b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/build/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ func (c *layerCache) getMeta(ctx context.Context, file string) (*v1.Hash, *v1.De
return nil, nil, fmt.Errorf("no buildid for %s", file)
}

// TODO: Implement better per-file locking.
c.Lock()
defer c.Unlock()

btod, err := c.readBuildToDiff(file)
if err != nil {
return nil, nil, err
Expand Down

0 comments on commit 1425e4b

Please sign in to comment.