From b215a41be46cd463d5cfcc3deb7a7ab7028c1903 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gy=C3=B6rgy=20Krajcsovits?= Date: Wed, 15 May 2024 14:02:39 +0200 Subject: [PATCH] tsdb/index/postings: fix missing lock unlock MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Followup to #14096 Unfortunately the previous PR introduced this bug by not releasing the lock before returning. Signed-off-by: György Krajcsovits --- tsdb/index/postings.go | 1 + 1 file changed, 1 insertion(+) diff --git a/tsdb/index/postings.go b/tsdb/index/postings.go index c6cf20e0e..159f6416e 100644 --- a/tsdb/index/postings.go +++ b/tsdb/index/postings.go @@ -419,6 +419,7 @@ func (p *MemPostings) PostingsForLabelMatching(ctx context.Context, name string, count := 1 for _, v := range vals { if count%checkContextEveryNIterations == 0 && ctx.Err() != nil { + p.mtx.RUnlock() return ErrPostings(ctx.Err()) } count++