I am seeing issues with how Deadline works at present in the presence of 
failing connections. What I found in my tests & research regarding my 
Android use case:


   - I am missing an option to explicitly fail a connection (signal that 
   the connection is broken) when a Deadline expires. An expired Deadline in 
   my Android use case would typically mean that the connection is broken, and 
   reconnecting may help.
   - Detecting broken connections with Keep-Alives does not work so well in 
   conjunction with Deadlines. If all RPCs have failed due to expired 
   Deadlines caused by a broken connection then using Keep-Alive won't detect 
   the broken connection unless I set 
   NettyServerBuilder.permitKeepAliveWithoutCalls(true) and 
   OkHttpChannelBuilder.keepAliveWithoutCalls(true), which judging by the 
   documentation does not seem the best idea.

Deadlines are useful, for example, when there is a user waiting for a 
response - I have to take action when nothing comes back after 20 or 30 
seconds. Setting KeepAlive to such small values as a workaround would not 
be a good idea.

I started looking at creating my own LoadBalancer as a workaround, which 
seems less architecturally insane than recreating the Channel. I am 
thinking when I sense a broken connection via an expired Deadline I can 
shutdown() the old Subchannel and create a new Subchannel for the same 
address. I'm not sure how to signal all other open RPCs to error out as if 
connection failure had been detected by Keep-Alive - I'd have that problem 
even with the channel recreation workaround.

Thoughts?

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/1ace2ba0-e1d1-44de-a49c-43d1033807ae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to