mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-26 06:04:05 -08:00
tsdb/index/postings: fix missing lock unlock
Followup to #14096 Unfortunately the previous PR introduced this bug by not releasing the lock before returning. Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
This commit is contained in:
parent
fdaafdb041
commit
b215a41be4
|
@ -419,6 +419,7 @@ func (p *MemPostings) PostingsForLabelMatching(ctx context.Context, name string,
|
||||||
count := 1
|
count := 1
|
||||||
for _, v := range vals {
|
for _, v := range vals {
|
||||||
if count%checkContextEveryNIterations == 0 && ctx.Err() != nil {
|
if count%checkContextEveryNIterations == 0 && ctx.Err() != nil {
|
||||||
|
p.mtx.RUnlock()
|
||||||
return ErrPostings(ctx.Err())
|
return ErrPostings(ctx.Err())
|
||||||
}
|
}
|
||||||
count++
|
count++
|
||||||
|
|
Loading…
Reference in a new issue