Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catching grpc connection configuration errors at startup #7164

Closed
leefernandes opened this issue Apr 23, 2024 · 2 comments
Closed

Catching grpc connection configuration errors at startup #7164

leefernandes opened this issue Apr 23, 2024 · 2 comments
Assignees

Comments

@leefernandes
Copy link

leefernandes commented Apr 23, 2024

Please demonstrate or explain the recommended pattern for catching ClientConn configuration errors (such as incorrect target value) at startup time of an application. A simple check that the server can be reached given the target and dial options.

Would it be recommended to use the health/grpc_health_v1 package, ClientConn Connect, or another approach?

@purnesh42H
Copy link
Collaborator

purnesh42H commented Apr 30, 2024

Using health/grpc_health_v1 is the recommended way to check health status of the server from client but it requires servers to implement Check method and return a meaningful response where as ClientConn Connect can do a simple connectivity check without requiring any server implementation. However, ClientConn Connect doesn't provide any health status of the service.

@purnesh42H
Copy link
Collaborator

purnesh42H commented May 9, 2024

Instead of relying on failures at dial time, developers are strongly arranged to rely on errors from RPCs. When a client makes an RPC, it can receive an error response from the server. These errors can provide valuable information about what went wrong, including information about network issues, server-side errors, and incorrect usage of the gRPC API. Consider using the example in Best practices for error handling in gRPC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants