Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions grpc_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,16 @@ func (c *GRPCClient) Dispense(name string) (interface{}, error) {
// ClientProtocol impl.
func (c *GRPCClient) Ping() error {
client := grpc_health_v1.NewHealthClient(c.Conn)
_, err := client.Check(context.Background(), &grpc_health_v1.HealthCheckRequest{
resp, err := client.Check(context.Background(), &grpc_health_v1.HealthCheckRequest{
Service: GRPCServiceName,
})
if err != nil {
return err
}

if resp.Status != grpc_health_v1.HealthCheckResponse_SERVING {
return fmt.Errorf("plugin %q health check returned non-SERVING status: %s", GRPCServiceName, resp.Status)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't GRPCServiceName just the const "plugin"? This looks like we've grabbed that without knowing where it came from.

}

return err
return nil
}