MCPcopy
hub / github.com/grafana/tempo / stopping

Method stopping

modules/frontend/queue/queue.go:212–227  ·  view source on GitHub ↗
(_ error)

Source from the content-addressed store, hash-verified

210}
211
212func (q *RequestQueue) stopping(_ error) error {
213 q.mtx.Lock()
214 defer q.mtx.Unlock()
215
216 for q.queues.len() > 0 {
217 q.cond.Wait(context.Background())
218 }
219
220 // Only stop after dispatching enqueued requests.
221 q.stopped = true
222
223 // If there are still goroutines in GetNextRequestForQuerier method, they get notified.
224 q.cond.Broadcast()
225
226 return nil
227}
228
229// contextCond is a *sync.Cond with Wait() method overridden to support context-based waiting.
230type contextCond struct {

Callers 4

TestGetNextBatchesFunction · 0.45

Calls 2

WaitMethod · 0.65
lenMethod · 0.45

Tested by 4

TestGetNextBatchesFunction · 0.36