Merge pull request #146 from prometheus/deadlock

Add missing unlock on early return
This commit is contained in:
Goutham Veeramachaneni 2017-09-18 15:02:32 +05:30 committed by GitHub
commit 2187388292
1 changed files with 1 additions and 0 deletions

View File

@ -1023,6 +1023,7 @@ func (s *stripeSeries) getOrSet(hash uint64, series *memSeries) (*memSeries, boo
s.locks[i].Lock()
if prev := s.hashes[i].get(hash, series.lset); prev != nil {
s.locks[i].Unlock()
return prev, false
}
s.hashes[i].set(hash, series)