Skip to content

Commit

Permalink
Fix Data Race in checkoutSeriesWithLock
Browse files Browse the repository at this point in the history
  • Loading branch information
miroswan committed Feb 28, 2021
1 parent da44ea0 commit 7bf92e8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/dbnode/storage/bootstrap/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,9 @@ func (a *TestDataAccumulator) checkoutSeriesWithLock(
mockSeries.EXPECT().
LoadBlock(gomock.Any(), gomock.Any()).
DoAndReturn(func(bl block.DatabaseBlock, _ series.WriteType) error {
a.Lock()
defer a.Unlock()

reader, err := bl.Stream(context.NewBackground())
if err != nil {
streamErr = err
Expand Down

0 comments on commit 7bf92e8

Please sign in to comment.