Skip to content

Commit

Permalink
go/store/nbs: table_set.go: Fix race on ret map in openForAdd.
Browse files Browse the repository at this point in the history
  • Loading branch information
reltuk committed Feb 11, 2025
1 parent 14e2c0e commit 17d5e24
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion go/store/nbs/table_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,10 @@ func (ts tableSet) openForAdd(ctx context.Context, files map[hash.Hash]uint32, s
eg, ctx := errgroup.WithContext(ctx)
var mu sync.Mutex
for fileId, chunkCount := range files {
if _, ok := ret[fileId]; ok {
mu.Lock()
_, ok := ret[fileId]
mu.Unlock()
if ok {
continue
}
eg.Go(func() error {
Expand Down

0 comments on commit 17d5e24

Please sign in to comment.