Skip to content

Commit

Permalink
Improve documentation comments for health service (#135)
Browse files Browse the repository at this point in the history
This commit somewhat improves the documentation of
`grpc.health.v1.Health`:

- It directs readers to the specification
  (https://github.com/grpc/grpc/blob/master/doc/health-checking.md),
  which feels a bit too long to inline into comments.
- It explains the semantics of the `Check` RPC a bit more thoroughly,
  clarifying that implementations should be idempotent and side effect
  free.
  • Loading branch information
akshayjshah authored Sep 8, 2023
1 parent 374b488 commit 6565a1b
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions grpc/health/v1/health.proto
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,19 @@ message HealthCheckResponse {
ServingStatus status = 1;
}

// Health is gRPC's mechanism for checking whether a server is able to handle
// RPCs. Its semantics are documented in
// https://github.com/grpc/grpc/blob/master/doc/health-checking.md.
service Health {
// If the requested service is unknown, the call will fail with status
// NOT_FOUND.
// Check gets the health of the specified service. If the requested service
// is unknown, the call will fail with status NOT_FOUND. If the caller does
// not specify a service name, the server should respond with its overall
// health status.
//
// Clients should set a deadline when calling Check, and can declare the
// server unhealthy if they do not receive a timely response.
//
// Check implementations should be idempotent and side effect free.
rpc Check(HealthCheckRequest) returns (HealthCheckResponse);

// Performs a watch for the serving status of the requested service.
Expand Down

0 comments on commit 6565a1b

Please sign in to comment.