This can be eventually detected by 
setting keepAliveTime(), keepAliveTimeout(), maxConnectionIdle(), 
maxConnectionAge(), and so forth on your ServerBuilder.    

In general, it's not possible to quickly detect if the remote side has 
silently stopped, so the best we can do is actively check, and set 
timeouts. 

On Thursday, April 12, 2018 at 2:07:54 PM UTC-7, Christopher Schechter 
wrote:
>
> Hi all,
>
> I'm working on setting up a server-side stream GRPC. When the stream is 
> started, the server should stream messages to the client until either the 
> server or the client shuts down.
>
> When the server shuts down, this is easy - it calls 
> StreamObserver.onCompleted() and the client is then notified that the 
> stream is ending.
>
> When clients shut down, they can do a graceful shutdown with 
> ManagedChannel.shutdownNow() to stop the stream from their end. However, 
> when the client shuts down ungracefully, the server never notices, and can 
> continue to call StreamObserver.onNext() basically forever.
>
> My question is, is there a way to detect this situation from the server 
> side when the client shuts down ungracefully? I would expect an exception 
> to be thrown at some point, but that never happens. Can I manually check 
> something to see whether the connection is broken?
>
> I've seen one other mention of a similar/same issue in this topic 
> <https://groups.google.com/forum/#!msg/grpc-io/aFsIiGnQKTY/ipbaPKuvBgAJ>, 
> which is from a long time ago but I don't see a resolution to it.
>
> Thanks,
> Chris
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to grpc-io@googlegroups.com.
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/998b7f64-7a79-4156-be06-dec73aa81574%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to