Merge pull request #401 from erock2112/master

Fix unprotected write in metricMap
This commit is contained in:
Björn Rabenstein 2018-04-09 16:46:44 +02:00 committed by GitHub
commit 2f0e84125d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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