grpc-go: get ClientConn to reconnect forever

3,135 views
Skip to first unread message

antoine...@gmail.com

unread,
Aug 27, 2015, 2:56:35 AM8/27/15
to grpc.io
Hello,

I'd like to know if it's possible to have a ClientConn try to reconnect forever? I have a service that needs to be resilient to one of its dependencies failing. When the dependency goes offline for some reason, I use a circuit breaker that gets triggered and gives me a chance to handle the failure by using a fallback solution. Eventually in the future, the dependency would come back online and the circuit breaker would close back, the behavior of my service returning to normal.

My problem is that after a timeout, grpc-go seems to consider a client connection to be shutdown and it seems it will not try to reconnect anymore. So my circuit breaker never closes back and all the instances of my service remain in degraded mode until I restart their process. So is there a way to have the ClientConn retry forever, until explicitly closed?

Qi Zhao

unread,
Aug 27, 2015, 3:03:19 AM8/27/15
to antoine...@gmail.com, grpc.io
If you do not set a connect time, grpc-go will keep reconnecting. The interval between reconnecting is exponential backoff.


--
You received this message because you are subscribed to the Google Groups "grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+u...@googlegroups.com.
To post to this group, send email to grp...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/dc791ec2-a182-4f37-ae49-ea8142cf8f6f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Thanks,
-Qi

Antoine Grondin

unread,
Aug 27, 2015, 4:05:14 AM8/27/15
to Qi Zhao, grpc.io
Ugh you're right! I didn't quite catch that from the code, but I get it now. Thanks!


Cheers, 

--
Antoine Grondin

Live long and prosper
Reply all
Reply to author
Forward
0 new messages