akka / akka-grpc

Akka gRPC
https://doc.akka.io/docs/akka-grpc/
Other
431 stars 124 forks source link

Lifecycle of ManagedClient #284

Open chbatey opened 6 years ago

chbatey commented 6 years ago

A gRPC channel is a long lived, expensive object that handles reconnects / closing of connections when idle.

It doesn't have a " fully broken", it looks to keep retrying (with exponential backoff) forever in the TRANSIENT_FAILURE state.

Should we interpret being in this state too long as an error and re-create the channel with a ServiceDiscovery lookup?

WDYT @patriknw @raboof ?

raboof commented 6 years ago

That sounds like a reasonable workaround until we have 'proactive' rediscovery in akka-discovery :+1:

patriknw commented 6 years ago

I think that would be good, and I think it would be enough with that Future that I talked about previously and then the client can be recreated with a new discovery from the outside. Later that could be handled by managed call api.

From https://github.com/grpc/grpc/blob/master/doc/connectivity-semantics-and-api.md it looks like we can observe transitions between TRANSIENT_FAILURE and CONNECTING and count a few of those before failing the future. Resetting the counter when changed to READY.

chbatey commented 6 years ago

I'll also do the close() to return a Future while doing this