mirror of
https://github.com/prometheus/prometheus.git
synced 2025-01-13 06:47:28 -08:00
Fix a locking bug.
Change-Id: I183780785991d0b4165ce9186f53eb8201fb3ed5
This commit is contained in:
parent
358f97791d
commit
01dd618a20
|
@ -115,7 +115,6 @@ func (s *memorySeriesStorage) appendSample(sample *clientmodel.Sample) {
|
|||
|
||||
fp := sample.Metric.Fingerprint()
|
||||
series := s.getOrCreateSeries(fp, sample.Metric)
|
||||
// TODO: Can we release s.mtx here already?
|
||||
series.add(fp, &metric.SamplePair{
|
||||
Value: sample.Value,
|
||||
Timestamp: sample.Timestamp,
|
||||
|
@ -181,7 +180,9 @@ func (s *memorySeriesStorage) preloadChunksForRange(fp clientmodel.Fingerprint,
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
s.mtx.Lock()
|
||||
series = s.getOrCreateSeries(fp, metric)
|
||||
defer s.mtx.Unlock() // Ugh.
|
||||
}
|
||||
}
|
||||
return series.preloadChunksForRange(from, through, s.persistence)
|
||||
|
|
Loading…
Reference in a new issue