Skip to content

Commit

Permalink
Fix a data race in the loadWAL function caused by reusing the same er…
Browse files Browse the repository at this point in the history
…ror var in multiple goroutines (prometheus#9259) (prometheus#9263)

Signed-off-by: Callum Styan <[email protected]>

Co-authored-by: Callum Styan <[email protected]>
  • Loading branch information
codesome and cstyan authored Aug 27, 2021
1 parent dcb07e8 commit f4c63b9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tsdb/head.go
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,7 @@ func (h *Head) loadWAL(r *wal.Reader, multiRef map[uint64]uint64, mmappedChunks
wg.Add(1)
exemplarsInput = make(chan record.RefExemplar, 300)
go func(input <-chan record.RefExemplar) {
var err error
defer wg.Done()
for e := range input {
ms := h.series.getByID(e.Ref)
Expand Down

0 comments on commit f4c63b9

Please sign in to comment.