stopping runs when MultitenantAlertmanager transitions to Stopping state.
(_ error)
| 774 | |
| 775 | // stopping runs when MultitenantAlertmanager transitions to Stopping state. |
| 776 | func (am *MultitenantAlertmanager) stopping(_ error) error { |
| 777 | am.alertmanagersMtx.Lock() |
| 778 | for _, am := range am.alertmanagers { |
| 779 | am.StopAndWait() |
| 780 | } |
| 781 | am.alertmanagersMtx.Unlock() |
| 782 | if am.peer != nil { // Tests don't setup any peer. |
| 783 | err := am.peer.Leave(am.cfg.Cluster.PeerTimeout) |
| 784 | if err != nil { |
| 785 | level.Warn(am.logger).Log("msg", "failed to leave the cluster", "err", err) |
| 786 | } |
| 787 | } |
| 788 | |
| 789 | if am.subservices != nil { |
| 790 | // subservices manages ring and lifecycler, if sharding was enabled. |
| 791 | _ = services.StopManagerAndAwaitStopped(context.Background(), am.subservices) |
| 792 | } |
| 793 | return nil |
| 794 | } |
| 795 | |
| 796 | // loadAlertmanagerConfigs Loads (and filters) the alertmanagers configuration from object storage, taking into consideration the sharding strategy. Returns: |
| 797 | // - The list of discovered users (all users with a configuration in storage) |
nothing calls this directly
no test coverage detected