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

grpc server get stuck but clientHealthCheck do not report server unhealthy #5214

Closed
heartlock opened this issue Mar 1, 2022 · 6 comments
Closed

Comments

@heartlock
Copy link

heartlock commented Mar 1, 2022

What version of gRPC are you using?

version: v1.38.0

What version of Go are you using (go version)?

golang: 1.17.4

What operating system (Linux, Windows, …) and version?

linux

What did you do?

I use kill -19 to stop grpc server, but clientHealthCheck do not report server unhealthy.

What did you expect to see?

report server unhealthy

What did you see instead?

grpc server get stuck, but clientHealthCheck do not report server unhealthy

@heartlock
Copy link
Author

heartlock commented Mar 1, 2022

@dfawley Would you like to have a look?

err = s.RecvMsg(resp)

watch stream receives nothing when GRPC server gets stuck. GRPC balancer may send requests to this stuck endpoint.

@dfawley
Copy link
Member

dfawley commented Mar 1, 2022

The client-side health checks (which must be enabled via the service config) interact with the server's health check service (go impl). The client also needs to import the health package.

Are you sure you have both sides configured properly?

@dfawley
Copy link
Member

dfawley commented Mar 1, 2022

@heartlock
Copy link
Author

heartlock commented Mar 2, 2022

The client-side health checks (which must be enabled via the service config) interact with the server's health check service (go impl). The client also needs to import the health package.

Are you sure you have both sides configured properly?

@dfawley I am sure that healthcheck service works on both sides. Client-side got first HealthCheckResponse, but got nothing after I kill -19 server. clientHealthCheck function will always be stuck in err = s.RecvMsg(resp). The server becomes a zombie process, will do not send anything to the client.

root@luke:~/workspace/mod-pro/test# ./client 
2022/03/02 09:28:46 Greeting: Hello world
2022/03/02 09:28:46 health respnse: status:SERVING



@dfawley
Copy link
Member

dfawley commented Mar 2, 2022

Can you try enabling keepalives on your client? https://github.com/grpc/grpc-go/tree/master/examples/features/keepalive for an example.

@heartlock
Copy link
Author

GRPC keepalive works for me. Thanks for your help. @dfawley I will close this issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 31, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants