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

Method AddressAdded

pkg/querier/worker/worker.go:201–224  ·  view source on GitHub ↗
(address string)

Source from the content-addressed store, hash-verified

199}
200
201func (w *querierWorker) AddressAdded(address string) {
202 ctx := w.ServiceContext()
203 if ctx == nil || ctx.Err() != nil {
204 return
205 }
206
207 w.mu.Lock()
208 defer w.mu.Unlock()
209
210 if m := w.managers[address]; m != nil {
211 return
212 }
213
214 level.Info(w.log).Log("msg", "adding connection", "addr", address)
215 conn, err := w.connect(address)
216 if err != nil {
217 level.Error(w.log).Log("msg", "error connecting", "addr", address, "err", err)
218 return
219 }
220
221 w.managers[address] = newProcessorManager(ctx, w.processor, conn, address)
222 // Called with lock.
223 w.resetConcurrency()
224}
225
226func (w *querierWorker) AddressRemoved(address string) {
227 level.Info(w.log).Log("msg", "removing connection", "addr", address)

Callers

nothing calls this directly

Calls 7

connectMethod · 0.95
resetConcurrencyMethod · 0.95
newProcessorManagerFunction · 0.85
ServiceContextMethod · 0.80
ErrMethod · 0.65
LogMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected