(_ context.Context, request *LivenessCheckRequest)
| 605 | } |
| 606 | |
| 607 | func (r *Ruler) LivenessCheck(_ context.Context, request *LivenessCheckRequest) (*LivenessCheckResponse, error) { |
| 608 | if r.lifecycler.ServiceContext() == nil { |
| 609 | return nil, errors.New("ruler is not yet ready") |
| 610 | } |
| 611 | if r.lifecycler.ServiceContext().Err() != nil || r.subservices.IsStopped() { |
| 612 | return nil, errors.New("ruler's context is canceled and might be stopping soon") |
| 613 | } |
| 614 | if !r.subservices.IsHealthy() { |
| 615 | return nil, errors.New("not all subservices are in healthy state") |
| 616 | } |
| 617 | return &LivenessCheckResponse{State: int32(r.State())}, nil |
| 618 | } |
| 619 | |
| 620 | // This function performs a liveness check against the provided replicas. If any one of the replicas responds with a state = Running, then |
| 621 | // this Ruler should not take ownership of the rule group. Otherwise, this Ruler must take ownership of the rule group to avoid missing evaluations |
nothing calls this directly
no test coverage detected