On Thu, Dec 1, 2016 at 3:40 PM, Arpit Baldeva <[email protected]> wrote:

> 1. *Detecting a dead client on server:* Is there a way or recommended
> mechanism to detect a client who is no longer connected to the server after
> an abrupt client shutdown? In our current framework, we get a TCP level
> disconnect which then ends the user session. But looking around the gRPC
> code base and searching past discussions in the group, the connection layer
> is hidden away and this information is not exposed. Detecting a dead client
> early is important in scenarios where client's state may be important to
> other clients. We have many use cases for it. For example, if two players
> are connected in a game session and one of them goes away, we'd like to
> update the status of that person on other client's machine.
>

We tend to use streams for this use-case. When gRPC learns of the
connection failure, any RPCs on that connection fail. Although note that a
single Channel can have multiple connections open underneath, so the
connection that failed may not be the one with the stream.

I was wondering if I have a bi-directional streaming RPC for the sole
> purpose of detecting a disconnect, would I get any error on that stream in
> case of an abrupt client shutdown? It did not seem like that from the async
> interface though (async_stream.h).
>

Bi-di stream works great (although any streaming RPC can work). On
server-side it should be exposed as a client cancellation.

2. *Server side connection management:* Is there a doc that details the
> server side connection management? I am trying to figure out details like
> how long does a socket remain active for an inactive client? Is this a
> setting that can be customized?
>

I've been working on a design that would add a MAX_CONNECTION_IDLE
server-side configuration, which seems to fit what you're wanting. So it's
not there now, but it's coming.

Are there any sort of connection metrics that are exposed to the
> application?
>

What connection metrics specifically? We've been adding some metric APIs in
the various implementations recently.

-- 
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/CA%2B4M1oNAhpD88yL7Yuv0r6kr4Zk5f_YxxBFj9gh0AcFu%3DV8Xpw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to