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

Method stop

pkg/querier/worker/processor_manager.go:43–57  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

41}
42
43func (pm *processorManager) stop() {
44 // Notify the remote query-frontend or query-scheduler we're shutting down.
45 // We use a new context to make sure it's not cancelled.
46 notifyCtx, cancel := context.WithTimeout(context.Background(), notifyShutdownTimeout)
47 defer cancel()
48 pm.p.notifyShutdown(notifyCtx, pm.conn, pm.address)
49
50 // Stop all goroutines.
51 pm.concurrency(0)
52
53 // Wait until they finish.
54 pm.wg.Wait()
55
56 _ = pm.conn.Close()
57}
58
59func (pm *processorManager) concurrency(n int) {
60 pm.cancelsMu.Lock()

Callers 3

stoppingMethod · 0.45
AddressRemovedMethod · 0.45

Calls 4

concurrencyMethod · 0.95
notifyShutdownMethod · 0.65
CloseMethod · 0.65
WaitMethod · 0.45

Tested by 1