My concern is that if the client connection is closed, no matter gracefully 
or not, the application layer might need to do some cleaning according to 
the event, e.g., to remove authentication information from the server. 
Haven't find a way to do that.

On Thursday, October 29, 2015 at 1:56:11 AM UTC+8, Qi Zhao wrote:
>
> Depending on what the definition of "ungracefully", we have different 
> answers:
>
> i) If TCP stack gets a chance to send RST to the server, the server will 
> find this connection error immediately and close all contexts;
> ii) if it is really "ungraceful" (e.g., unplug the network cable), right 
> now grpc relies on TCP user timeout to detect it, which may take tens of 
> minutes depending on the kernel configuration. Unfortunately, we have not 
> fleshed out a server side heart beat to detect this (in our radar though) 
> by now. Thus, users might need to rely on their own health checking 
> mechanism for now.
>
> On Tue, Oct 27, 2015 at 3:50 PM, Aaron Beitch <[email protected] 
> <javascript:>> wrote:
>
>> Hello,
>>
>> tl;dr: Does HTTP2 do any heartbeat with the client? Can a streaming rpc's 
>> context.Done channel be closed if the client dies ungracefully?
>>
>> In my application I have bidirectional communication. I implement this 
>> with one unary rpc for client-to-server messages and one streaming rpc for 
>> server-to-client communications. When a client dies ungracefully my server 
>> leaks resources because there is a goroutine sitting around waiting for 
>> data to send to the client, but never notices the client disconnected.
>>
>> I was hoping that just waiting on the ctx.Done channel would notify me 
>> when the client disappears, but that doesn't appear to work. I could add a 
>> heartbeat mechanism, but I was hoping to not have to do that. Does HTTP2 do 
>> any heartbeat with the client? Can a streaming rpc's context.Done channel 
>> be closed if the client dies ungracefully?
>>
>> Thanks,
>> Aaron
>>
>> -- 
>> 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] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/grpc-io/3d923856-3c73-4590-bb36-7b9af29e9a8c%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/grpc-io/3d923856-3c73-4590-bb36-7b9af29e9a8c%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Thanks,
> -Qi
>

-- 
*Grab is hiring. Learn more at **https://grab.careers 
<https://grab.careers/>*

By communicating with Grab Inc and/or its subsidiaries, associate companies 
and jointly controlled entities (“Grab Group”), you are deemed to have 
consented to processing of your personal data as set out in the Privacy 
Notice which can be viewed at https://grab.com/privacy/

This email contains confidential information and is only for the intended 
recipient(s). If you are not the intended recipient(s), please do not 
disseminate, distribute or copy this email and notify Grab Group 
immediately if you have received this by mistake and delete this email from 
your system. Email transmission cannot be guaranteed to be secure or 
error-free as any information therein could be intercepted, corrupted, 
lost, destroyed, delayed or incomplete, or contain viruses. Grab Group do 
not accept liability for any errors or omissions in the contents of this 
email arises as a result of email transmission. All intellectual property 
rights in this email and attachments therein shall remain vested in Grab 
Group, unless otherwise provided by law.

-- 
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/ac6e47f6-352d-4705-ae5f-880c8a2259c0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to