I am using gRPC with ruby on both client and server side. I was managing the client connection in this way:
1. Create the connection once when application starts ->
@SEARCH_CLIENT = Search::HouseSearchService::Stub.new('localhost:50052', :this_channel_is_insecure)
2. Use the client instance to make gRPC calls during runtime.
@SEARCH_CLIENT.search(request)
The problem that I am facing in this scheme is that whenever I restart my service, the gRPC call returns a GRPC BadStatus 14
Is it okay to create the connection and make the call together everytime during runtime for each call? Or should I just put some error handling myself to re-connect in case I get an error?