Yes, it's an API expectation that ServerContext is alive for the duration 
of the RPC and there is no guaranteed behavior otherwise.

On Tuesday, March 19, 2019 at 10:19:47 AM UTC-7, Nick Cox wrote:
>
> Is the behavior undefined if it doesn't?
>
> On Tue, Mar 19, 2019, 10:06 AM 'Vijay Pai' via grpc.io <
> [email protected] <javascript:>> wrote:
>
>> The ServerContext needs to stay alive for the duration of the RPC.
>>
>> On Monday, March 18, 2019 at 4:00:06 PM UTC-7, [email protected] 
>> wrote:
>>>
>>> Hi,
>>>
>>> I have a question about the behavior of gRPC C++ async; If the call data 
>>> is deleted in the middle of a call, for example, in a server streaming 
>>> call, where call data is:
>>>
>>> struct CallData {
>>>   grpc::ServerContext ctx;
>>>   RpcRequest request;
>>>   grpc::ServerAsyncWriter<RpcResponse> response_writer;
>>> }
>>>
>>> Is the behavor defined if this call data is deleted before calling 
>>> response_writer.Finish(...) and receiving the returned tag.  Ie. the from a 
>>> previous call to response_writer.Write(...) was returned, but before 
>>> invoking Finish(), the CallData is deleted.  My assumption is that the call 
>>> would be cancelled and the client would receive an error.  But should we 
>>> expect to see gRPC assertion failures on the server side during cleanup, or 
>>> should the server still be able to process additional requests, and 
>>> shutdown cleanly?
>>>
>>> Thanks!
>>> Nick
>>>
>> -- 
>> 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:>.
>> 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/28f0e823-e4ff-48a7-8f7c-569f458142bc%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/grpc-io/28f0e823-e4ff-48a7-8f7c-569f458142bc%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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/65e59226-ba76-44b0-95dc-eb0792bd2f90%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to