Re: [grpc-io] Re: What is the behaviour of grpc::ServerContext::IsCancelled()

2018-04-09 Thread Okke Hendriks
Our use case was that we had a RPC call 'FollowPath'.
This call instructs a robot to, you guessed it, follow a path. In case a 
client does a TryCancel() on the 'FollowPath' the robot must stop following 
the previously given path.
In case the WiFi connection fails and the RPC is 'aborted' the robot must 
continue following the path it was given.

So basically we want to know the difference between a failed call/stream 
and an actively canceled (by the client) call/stream.

On Friday, April 6, 2018 at 5:23:28 PM UTC+2, Noah Eisen wrote:
>
> Can you give a little more info about your use case? What exact 
> information do you need, and in what situations?
>
> I agree that digging into the non-public structs is a bad idea, since we 
> maybe change those from time to time. If you present a use case that is 
> lacking from our public API, we can add some new methods to ServerContext 
> to expose more details
>
> On Thu, Apr 5, 2018 at 1:10 AM Okke Hendriks  > wrote:
>
>> Thank you,
>>
>> Indeed it seems to be the case that it is more like IsFailed() instead of 
>> IsCanceled().
>>
>> If i examine the *grpc_call* 
>> 
>>  
>> struct, (accessible through the c++ API 
>> ,
>>  
>> but using it will require including non-public core lib headers? Which i do 
>> not want to do.) it has an *grpc_call_final_info* member defined here 
>> 
>> . 
>> Which includes a *grpc_status_code*  and error message, I do not know if 
>> these are set on the server side, but this might be something to expose on 
>> the C/C++ API?
>>
>>
>> On Wednesday, April 4, 2018 at 7:25:14 PM UTC+2, ncte...@google.com 
>> wrote:
>>>
>>> Taking a look at the C API, it looks like IsCancelled() will be true "if 
>>> the call failed in any way". See here 
>>> 
>>> .
>>>
>>> There is not an API method to determine more info about error, but that 
>>> should be available by examining logs. (setting GRPC_VERBOSITY=debug and 
>>> GRPC_TRACE=all)
>>>
>>> On Wednesday, March 28, 2018 at 11:45:36 AM UTC-7, Okke Hendriks wrote:

 Hello,

 I am using the sync grpc C++ API v1.10.0.

 Could someone explain to me what the exact behaviour of IsCancelled() 
 
  is?

 Does it evaluate to true if and only if the client sends a TryCancel() 
 which was received by the server? 
 Or also if a call/stream closed due to another reason (socket closed, 
 OS error, etc.)?

 If it is NOT the case that it only returns true when a client 
 cancelled, is there a way to find the reason of the cancellation, aka the 
 status?

 Kind regards,

 Okke Hendriks

>>> -- 
>> 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+u...@googlegroups.com .
>> To post to this group, send email to grp...@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/505433e8-0b74-44f0-9895-d097a240b786%40googlegroups.com
>>  
>> 
>> .
>> 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 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/d7ffea9a-981b-40bf-820e-d721b1dbb563%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [grpc-io] Re: What is the behaviour of grpc::ServerContext::IsCancelled()

2018-04-06 Thread 'Noah Eisen' via grpc.io
Can you give a little more info about your use case? What exact information
do you need, and in what situations?

I agree that digging into the non-public structs is a bad idea, since we
maybe change those from time to time. If you present a use case that is
lacking from our public API, we can add some new methods to ServerContext
to expose more details

On Thu, Apr 5, 2018 at 1:10 AM Okke Hendriks  wrote:

> Thank you,
>
> Indeed it seems to be the case that it is more like IsFailed() instead of
> IsCanceled().
>
> If i examine the *grpc_call*
> 
> struct, (accessible through the c++ API
> ,
> but using it will require including non-public core lib headers? Which i do
> not want to do.) it has an *grpc_call_final_info* member defined here
> 
> .
> Which includes a *grpc_status_code*  and error message, I do not know if
> these are set on the server side, but this might be something to expose on
> the C/C++ API?
>
>
> On Wednesday, April 4, 2018 at 7:25:14 PM UTC+2, ncte...@google.com wrote:
>>
>> Taking a look at the C API, it looks like IsCancelled() will be true "if
>> the call failed in any way". See here
>> 
>> .
>>
>> There is not an API method to determine more info about error, but that
>> should be available by examining logs. (setting GRPC_VERBOSITY=debug and
>> GRPC_TRACE=all)
>>
>> On Wednesday, March 28, 2018 at 11:45:36 AM UTC-7, Okke Hendriks wrote:
>>>
>>> Hello,
>>>
>>> I am using the sync grpc C++ API v1.10.0.
>>>
>>> Could someone explain to me what the exact behaviour of IsCancelled()
>>> 
>>>  is?
>>>
>>> Does it evaluate to true if and only if the client sends a TryCancel()
>>> which was received by the server?
>>> Or also if a call/stream closed due to another reason (socket closed, OS
>>> error, etc.)?
>>>
>>> If it is NOT the case that it only returns true when a client cancelled,
>>> is there a way to find the reason of the cancellation, aka the status?
>>>
>>> Kind regards,
>>>
>>> Okke Hendriks
>>>
>> --
> 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/505433e8-0b74-44f0-9895-d097a240b786%40googlegroups.com
> 
> .
> 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 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/CAPYwnkgR2BgXGRKqPBWJskJSX55LorFK5GA%2B0BgX%3D0%3Dzhv_W0w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[grpc-io] Re: What is the behaviour of grpc::ServerContext::IsCancelled()

2018-04-05 Thread Okke Hendriks
Thank you,

Indeed it seems to be the case that it is more like IsFailed() instead of 
IsCanceled().

If i examine the *grpc_call* 

 
struct, (accessible through the c++ API 
,
 
but using it will require including non-public core lib headers? Which i do 
not want to do.) it has an *grpc_call_final_info* member defined here 

. 
Which includes a *grpc_status_code*  and error message, I do not know if 
these are set on the server side, but this might be something to expose on 
the C/C++ API?


On Wednesday, April 4, 2018 at 7:25:14 PM UTC+2, ncte...@google.com wrote:
>
> Taking a look at the C API, it looks like IsCancelled() will be true "if 
> the call failed in any way". See here 
> 
> .
>
> There is not an API method to determine more info about error, but that 
> should be available by examining logs. (setting GRPC_VERBOSITY=debug and 
> GRPC_TRACE=all)
>
> On Wednesday, March 28, 2018 at 11:45:36 AM UTC-7, Okke Hendriks wrote:
>>
>> Hello,
>>
>> I am using the sync grpc C++ API v1.10.0.
>>
>> Could someone explain to me what the exact behaviour of IsCancelled() 
>> 
>>  is?
>>
>> Does it evaluate to true if and only if the client sends a TryCancel() 
>> which was received by the server? 
>> Or also if a call/stream closed due to another reason (socket closed, OS 
>> error, etc.)?
>>
>> If it is NOT the case that it only returns true when a client cancelled, 
>> is there a way to find the reason of the cancellation, aka the status?
>>
>> Kind regards,
>>
>> Okke Hendriks
>>
>

-- 
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/505433e8-0b74-44f0-9895-d097a240b786%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[grpc-io] Re: What is the behaviour of grpc::ServerContext::IsCancelled()

2018-04-04 Thread ncteisen via grpc.io
Taking a look at the C API, it looks like IsCancelled() will be true "if 
the call failed in any way". See here 

.

There is not an API method to determine more info about error, but that 
should be available by examining logs. (setting GRPC_VERBOSITY=debug and 
GRPC_TRACE=all)

On Wednesday, March 28, 2018 at 11:45:36 AM UTC-7, Okke Hendriks wrote:
>
> Hello,
>
> I am using the sync grpc C++ API v1.10.0.
>
> Could someone explain to me what the exact behaviour of IsCancelled() 
> 
>  is?
>
> Does it evaluate to true if and only if the client sends a TryCancel() 
> which was received by the server? 
> Or also if a call/stream closed due to another reason (socket closed, OS 
> error, etc.)?
>
> If it is NOT the case that it only returns true when a client cancelled, 
> is there a way to find the reason of the cancellation, aka the status?
>
> Kind regards,
>
> Okke Hendriks
>

-- 
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/b80bedc3-4718-4d5f-9202-885affadd32d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.