Skip to content

Commit

Permalink
receive/multitsdb: defer unlock properly (thanos-io#7857)
Browse files Browse the repository at this point in the history
Do not forget to unlock.

Signed-off-by: Giedrius Statkevičius <[email protected]>
  • Loading branch information
GiedriusS authored Oct 23, 2024
1 parent e5bb3a4 commit c10b695
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/receive/multitsdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -587,10 +587,10 @@ func (t *MultiTSDB) TSDBLocalClients() []store.Client {

t.mtx.RUnlock()
t.mtx.Lock()
defer t.mtx.Unlock()
if !t.tsdbClientsNeedUpdate {
return t.tsdbClients
}
defer t.mtx.Unlock()

res := make([]store.Client, 0, len(t.tenants))
for _, tenant := range t.tenants {
Expand Down

0 comments on commit c10b695

Please sign in to comment.