mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
Fix concurrent map access.
Signed-off-by: Goutham Veeramachaneni <cs14btech11014@iith.ac.in>
This commit is contained in:
parent
bacb143b7e
commit
c211ec4f49
3
head.go
3
head.go
|
@ -260,9 +260,12 @@ Outer:
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Map is accessed in other places also, so protect it.
|
||||||
|
h.mtx.Lock()
|
||||||
for k, v := range newStones {
|
for k, v := range newStones {
|
||||||
h.tombstones[k] = h.tombstones[k].add(v[0])
|
h.tombstones[k] = h.tombstones[k].add(v[0])
|
||||||
}
|
}
|
||||||
|
h.mtx.Unlock()
|
||||||
|
|
||||||
h.meta.NumTombstones = int64(len(h.tombstones))
|
h.meta.NumTombstones = int64(len(h.tombstones))
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Reference in a new issue