Fix unprotected write in metricMap
This commit is contained in:
parent
f504d69aff
commit
ddd94f24c5
|
@ -277,6 +277,9 @@ func (m *metricMap) deleteByHashWithLabelValues(
|
||||||
func (m *metricMap) deleteByHashWithLabels(
|
func (m *metricMap) deleteByHashWithLabels(
|
||||||
h uint64, labels Labels, curry []curriedLabelValue,
|
h uint64, labels Labels, curry []curriedLabelValue,
|
||||||
) bool {
|
) bool {
|
||||||
|
m.mtx.Lock()
|
||||||
|
defer m.mtx.Unlock()
|
||||||
|
|
||||||
metrics, ok := m.metrics[h]
|
metrics, ok := m.metrics[h]
|
||||||
if !ok {
|
if !ok {
|
||||||
return false
|
return false
|
||||||
|
|
Loading…
Reference in New Issue