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

Method starting

pkg/ruler/ruler.go:470–489  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

468}
469
470func (r *Ruler) starting(ctx context.Context) error {
471 // If sharding is enabled, start the used subservices.
472 if r.cfg.EnableSharding {
473 var err error
474
475 if r.subservices, err = services.NewManager(r.lifecycler, r.ring, r.clientsPool); err != nil {
476 return errors.Wrap(err, "unable to start ruler subservices")
477 }
478
479 r.subservicesWatcher = services.NewFailureWatcher()
480 r.subservicesWatcher.WatchManager(r.subservices)
481
482 if err = services.StartManagerAndAwaitHealthy(ctx, r.subservices); err != nil {
483 return errors.Wrap(err, "unable to start ruler subservices")
484 }
485 }
486
487 // TODO: ideally, ruler would wait until its queryable is finished starting.
488 return nil
489}
490
491// Stop stops the Ruler.
492// Each function of the ruler is terminated before leaving the ring

Callers

nothing calls this directly

Calls 5

NewManagerFunction · 0.92
NewFailureWatcherFunction · 0.92
WatchManagerMethod · 0.80
WrapMethod · 0.65

Tested by

no test coverage detected