I've faced a problem with error handling on my gRPC client. Shortly: I've got gRPC client and server both running in Kubernetes. Client makes synchronous calls to server to retrieve some data. Everything goes fine, but some time ago the client received an error rpc error: code = Unavailable desc = resolver returned no addresses
. I've restarted the POD and it has reconnected without any problems.
After googling and looking into the gRPC balancer source code I've found that this error returns when the balancer cannot get the IP from a DNS (thats quite logical). It seems to be effects of Kubernetes PODs rebalancing or so.
But the question is how to handle this error properly? GRPC client has built in reconnection mechanism but it's not triggered in that situation. Of course I can catch this error, close existing connection and make a dial again, but I don't want to build a bicycle if there is more correct way to handle it.
Thank you!