Skip to content

Commit

Permalink
receive/multitsdb: remove double lock (#7700)
Browse files Browse the repository at this point in the history
Do not double lock here as in some situations it could lead to a
dead-lock situation.

Signed-off-by: Giedrius Statkevičius <[email protected]>
  • Loading branch information
GiedriusS authored Sep 5, 2024
1 parent 8c8a88e commit 0966192
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions pkg/receive/multitsdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,17 +266,11 @@ func (t *tenant) readyStorage() *ReadyStorage {
return t.readyS
}

func (t *tenant) store() *store.TSDBStore {
t.mtx.RLock()
defer t.mtx.RUnlock()
return t.storeTSDB
}

func (t *tenant) client() store.Client {
t.mtx.RLock()
defer t.mtx.RUnlock()

tsdbStore := t.store()
tsdbStore := t.storeTSDB
if tsdbStore == nil {
return nil
}
Expand Down

0 comments on commit 0966192

Please sign in to comment.