MCPcopy Create free account
hub / github.com/cortexproject/cortex / acquireReadLock

Method acquireReadLock

pkg/ingester/ingester.go:1754–1771  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1752}
1753
1754func (u *userTSDB) acquireReadLock() error {
1755 u.stateMtx.RLock()
1756 defer u.stateMtx.RUnlock()
1757
1758 switch u.state {
1759 case active:
1760 case activeShipping:
1761 case forceCompacting:
1762 // Read are allowed.
1763 case closing:
1764 return errors.New("TSDB is closing")
1765 default:
1766 return errors.New("TSDB is not active")
1767 }
1768
1769 u.readInFlight.Add(1)
1770 return nil
1771}
1772
1773func (u *userTSDB) releaseReadLock() {
1774 u.readInFlight.Done()

Callers 5

queryExemplarsMethod · 0.80
labelsValuesCommonMethod · 0.80
labelNamesCommonMethod · 0.80
queryStreamMethod · 0.80

Calls 1

AddMethod · 0.45

Tested by

no test coverage detected