Fix unprotected write in metricMap

This commit is contained in:
Eric Boren 2018-04-09 10:07:30 -04:00
parent f504d69aff
commit ddd94f24c5
1 changed files with 3 additions and 0 deletions

View File

@ -277,6 +277,9 @@ func (m *metricMap) deleteByHashWithLabelValues(
func (m *metricMap) deleteByHashWithLabels(
h uint64, labels Labels, curry []curriedLabelValue,
) bool {
m.mtx.Lock()
defer m.mtx.Unlock()
metrics, ok := m.metrics[h]
if !ok {
return false