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

Method stopping

pkg/ingester/ingester.go:1013–1032  ·  view source on GitHub ↗

runs when ingester is stopping

(_ error)

Source from the content-addressed store, hash-verified

1011
1012// runs when ingester is stopping
1013func (i *Ingester) stopping(_ error) error {
1014 // This will prevent us accepting any more samples
1015 i.stopIncomingRequests()
1016 // It's important to wait until shipper is finished,
1017 // because the blocks transfer should start only once it's guaranteed
1018 // there's no shipping on-going.
1019 if err := services.StopManagerAndAwaitStopped(context.Background(), i.TSDBState.subservices); err != nil {
1020 level.Warn(i.logger).Log("msg", "failed to stop ingester subservices", "err", err)
1021 }
1022
1023 // Next initiate our graceful exit from the ring.
1024 if err := services.StopAndAwaitTerminated(context.Background(), i.lifecycler); err != nil {
1025 level.Warn(i.logger).Log("msg", "failed to stop ingester lifecycler", "err", err)
1026 }
1027
1028 if !i.cfg.BlocksStorageConfig.TSDB.KeepUserTSDBOpenOnShutdown {
1029 i.closeAllTSDB()
1030 }
1031 return nil
1032}
1033
1034func (i *Ingester) updateLoop(ctx context.Context) error {
1035 rateUpdateTicker := time.NewTicker(i.cfg.RateUpdatePeriod)

Callers

nothing calls this directly

Implementers 1

Ingesterpkg/ingester/ingester.go

Calls 5

stopIncomingRequestsMethod · 0.95
closeAllTSDBMethod · 0.95
StopAndAwaitTerminatedFunction · 0.92
LogMethod · 0.45

Tested by

no test coverage detected