We have a grpc client and a grpc server.
To connect client to server we need to call grpc::CreateChannel(HOST:PORT)
, but:
- If server is not available – grpc generated client stub fails with an assertion.
- If server has been connected, than suddenly has aborted the connection – grpc fails with an assertion.
It’s “okay” if we are using python grpc lib, where we can catch AssertionError as an exception, but when we are talking about C++ – it doesn’t make sense, since this assertion will dump all the client app down.
Is there any proper way in gRPC C++ lib to process disconnection (or connection failure) from grpc server (in case, that disconnection cause could be the server itself)?