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

How to shutdown grpc clients #87

Closed
criatura2 opened this issue Nov 2, 2023 · 1 comment
Closed

How to shutdown grpc clients #87

criatura2 opened this issue Nov 2, 2023 · 1 comment

Comments

@criatura2
Copy link

Hi again, I have client-rpc-server-streaming that looks very similar to yours here and which is used in an app that has both grpc clients and servers. To shut them down cleanly I am avoiding calling GrpcContext::stop() and instead we only call m_server->Shutdown(). AFAICS though, this is not causing the grpc clients methods to return false and exit. In my case this is hanging forever here

RPC::Response response;
while (co_await rpc.read(response))
{
    std::cout << "Response: " << response.integer() << '\n';
}

I am wondering what is the proper way of shuting down the clients as well. Should I set a deadline on all my calls so they exit and I can check a flag to decide whether to retry or exit? But that wouldn't work well with streaming since in this case I want the requests to not timeout, otherwise I would be reconnecting too often to the peer.

Thanks.

@criatura2
Copy link
Author

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

No branches or pull requests

1 participant