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

when the grpc server restart,the grpcClient is not available,I have to restart the grpc client #976

Open
champion1Ping opened this issue Oct 10, 2023 · 6 comments
Labels
question A question about this library or its usage

Comments

@champion1Ping
Copy link

status=FAILURE, cause=[io.grpc.StatusRuntimeException: UNAVAILABLE: upstream connect error or disconnect/reset before headers. retried and the latest reset reason: connection failure

@champion1Ping champion1Ping added the question A question about this library or its usage label Oct 10, 2023
@champion1Ping
Copy link
Author

the server is implemented in go language

@fengli79
Copy link
Collaborator

In general, when the gRPC server get restarted, the client should be mostly intact, the underlying channel could be fall into an unavailable status, and depending on the client configuration, the error could be propagated to the user of the client or get silently retried.

Can you share your client configuration with more details? I'm new to the gRPC-Spring implementation, but this could lead to an area we can improve, with the default error handling & retry logic.

@ricardofernandess
Copy link

Have the same problem using both server and client implemented in Java. If the server has some temporary problem, when calling from the client I get io.grpc.StatusRuntimeException: UNAVAILABLE: io exception

Even if the server recovers from this failure i have to restart the client, otherwise the client gives the same error without calling the server again.

@ricardofernandess
Copy link

Upon further research it has to do with connection backoff described here https://github.com/grpc/grpc/blob/v1.32.0/doc/connection-backoff.md

Haven't found a way to disable this behaviour

@ST-DDT
Copy link
Collaborator

ST-DDT commented Dec 4, 2023

You might want to add a GrpcChannelConfigurer.
Although I'm not sure which option you need to change those. But you could ask that upstream or on StackOverflow.

@fengli79
Copy link
Collaborator

fengli79 commented Dec 6, 2023

In general, we have 2 layers need to cooperate on temp server failures.

  • On the channel level, when the underlying connection is broken, the channel will try to reconnect with that backoff strategy.
  • At the same moment, before a new connection get established and be available to use, the channel will in unavailable status, the RPC on that channel would get unavailable error.

Things missing here is to have a solid RPC retry strategy, thus the underlying connection issue can be hidden from the application layer. Unavailable error is typically retryable, but the application still need to be designed in a way to carefully distinguish idempotent and non-idempotent RPCs to avoid unsafe retries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question A question about this library or its usage
Projects
None yet
Development

No branches or pull requests

4 participants