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

Method stopping

pkg/scheduler/queue/queue.go:203–218  ·  view source on GitHub ↗
(_ error)

Source from the content-addressed store, hash-verified

201}
202
203func (q *RequestQueue) stopping(_ error) error {
204 q.mtx.Lock()
205 defer q.mtx.Unlock()
206
207 for q.queues.len() > 0 && q.connectedQuerierWorkers.Load() > 0 {
208 q.cond.Wait()
209 }
210
211 // Only stop after dispatching enqueued requests.
212 q.stopped = true
213
214 // If there are still goroutines in GetNextRequestForQuerier method, they get notified.
215 q.cond.Broadcast()
216
217 return nil
218}
219
220func (q *RequestQueue) RegisterQuerierConnection(querier string) {
221 q.connectedQuerierWorkers.Inc()

Callers

nothing calls this directly

Calls 4

lenMethod · 0.80
LoadMethod · 0.80
WaitMethod · 0.45
BroadcastMethod · 0.45

Tested by

no test coverage detected