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

Method notifyQuerierShutdown

pkg/scheduler/queue/user_queues.go:316–332  ·  view source on GitHub ↗

notifyQuerierShutdown records that a querier has sent notification about a graceful shutdown.

(querierID string)

Source from the content-addressed store, hash-verified

314
315// notifyQuerierShutdown records that a querier has sent notification about a graceful shutdown.
316func (q *queues) notifyQuerierShutdown(querierID string) {
317 info := q.queriers[querierID]
318 if info == nil {
319 // The querier may have already been removed, so we just ignore it.
320 return
321 }
322
323 // If there are no more connections, we should remove the querier.
324 if info.connections == 0 {
325 q.removeQuerier(querierID)
326 return
327 }
328
329 // Otherwise we should annotate we received a graceful shutdown notification
330 // and the querier will be removed once all connections are unregistered.
331 info.shuttingDown = true
332}
333
334// forgetDisconnectedQueriers removes all disconnected queriers that have gone since at least
335// the forget delay. Returns the number of forgotten queriers.

Callers 3

NotifyQuerierShutdownMethod · 0.80
TestQueuesConsistencyFunction · 0.80
TestQueues_ForgetDelayFunction · 0.80

Calls 1

removeQuerierMethod · 0.95

Tested by 2

TestQueuesConsistencyFunction · 0.64
TestQueues_ForgetDelayFunction · 0.64