Skip to content

Commit

Permalink
Merge pull request cockroachdb#22911 from asubiotto/lb-checks
Browse files Browse the repository at this point in the history
server: split health endpoint into health and readiness endpoints
  • Loading branch information
asubiotto authored Feb 28, 2018
2 parents 00c57b1 + 101db4a commit 34c7c69
Show file tree
Hide file tree
Showing 6 changed files with 323 additions and 257 deletions.
6 changes: 3 additions & 3 deletions pkg/server/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -1040,12 +1040,12 @@ func (s *adminServer) Cluster(
func (s *adminServer) Health(
ctx context.Context, req *serverpb.HealthRequest,
) (*serverpb.HealthResponse, error) {
isHealthy, err := s.server.nodeLiveness.IsHealthy(s.server.NodeID())
isLive, err := s.server.nodeLiveness.IsLive(s.server.NodeID())
if err != nil {
return nil, status.Errorf(codes.Internal, err.Error())
}
if !isHealthy {
return nil, status.Errorf(codes.Unavailable, "node is not healthy")
if !isLive {
return nil, status.Errorf(codes.Unavailable, "node is not live")
}
return &serverpb.HealthResponse{}, nil
}
Expand Down
Loading

0 comments on commit 34c7c69

Please sign in to comment.