runs when ingester is stopping
(_ error)
| 1011 | |
| 1012 | // runs when ingester is stopping |
| 1013 | func (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 | |
| 1034 | func (i *Ingester) updateLoop(ctx context.Context) error { |
| 1035 | rateUpdateTicker := time.NewTicker(i.cfg.RateUpdatePeriod) |
nothing calls this directly
no test coverage detected