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 <okkehe...@gmail.com 
> > 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* 
>> <https://github.com/grpc/grpc/blob/f3b28b81cf5825ce41cbfdf1a926972227034d91/src/core/lib/surface/call.cc#L205>
>>  
>> struct, (accessible through the c++ API 
>> <https://grpc.io/grpc/cpp/classgrpc_1_1_server_context.html#ac23879ea6fee39bbe27c6b6192989d61>,
>>  
>> 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 
>> <https://github.com/grpc/grpc/blob/dc46c7f565196d6684d5cf6ee81e99b413ba5282/src/core/lib/channel/channel_stack.h#L86>
>> . 
>> 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 
>>> <https://github.com/grpc/grpc/blob/master/include/grpc/impl/codegen/grpc_types.h#L597>
>>> .
>>>
>>> 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() 
>>>> <https://grpc.io/grpc/cpp/classgrpc_1_1_server_context.html#acea4ed6d22ccf89185194310935e2966>
>>>>  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
>>  
>> <https://groups.google.com/d/msgid/grpc-io/505433e8-0b74-44f0-9895-d097a240b786%40googlegroups.com?utm_medium=email_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 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.


[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* 
<https://github.com/grpc/grpc/blob/f3b28b81cf5825ce41cbfdf1a926972227034d91/src/core/lib/surface/call.cc#L205>
 
struct, (accessible through the c++ API 
<https://grpc.io/grpc/cpp/classgrpc_1_1_server_context.html#ac23879ea6fee39bbe27c6b6192989d61>,
 
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 
<https://github.com/grpc/grpc/blob/dc46c7f565196d6684d5cf6ee81e99b413ba5282/src/core/lib/channel/channel_stack.h#L86>
. 
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 
> <https://github.com/grpc/grpc/blob/master/include/grpc/impl/codegen/grpc_types.h#L597>
> .
>
> 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() 
>> <https://grpc.io/grpc/cpp/classgrpc_1_1_server_context.html#acea4ed6d22ccf89185194310935e2966>
>>  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] What is the behaviour of grpc::ServerContext::IsCancelled()

2018-03-28 Thread Okke Hendriks
Hello,

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

Could someone explain to me what the exact behaviour of IsCancelled() 
<https://grpc.io/grpc/cpp/classgrpc_1_1_server_context.html#acea4ed6d22ccf89185194310935e2966>
 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/cbd2da28-ec6f-4ac1-b676-133dc52874b3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[grpc-io] tcp_server_posix.c:395] Failed accept4: Invalid argument

2016-11-30 Thread Okke Hendriks

Hello,

I am using gRPC C++ 1.0.0 and running multiple nightly tests.
One of these tests is qualifying if on/multiple client can connect to a 
server.
Sporadically i am getting the following error in the output of my tests:

tcp_server_posix.c:395] Failed accept4: Invalid argument

When this happens, client are also unable to connect:

connection.test.h:71: Failure
Value of: mClient->Connected()
  Actual: false
Expected: true
connection.test.h:72: Failure
Value of: mClient->WaitForConnected(std::chrono::milliseconds(
TEST_CONNECTION_WAIT))
  Actual: false
Expected: true

So it seems that the server never starts running or at least does not 
accept connections.

When checking linux manual I am seeing the following:
*EINVAL* (*accept4*()) invalid value in *flags*.

The server and client(s) are both created in the same gtest process, 
running on a port on localhost.

I am not yet able to reproduce this consistently, but I am asking anyway in 
the hope this is known to someone here, or if somebody has an idea to 
reproduce this more consistently.

-- 
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/df81b9ce-deae-43c6-942c-6843363267d6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[grpc-io] Re: Stress test error: 'ignoring out of order new grpc_chttp2_stream request on server'

2016-11-10 Thread Okke Hendriks
When I increase the delay between making calls to 2ms instead of 1ms 
everything is fine.
Using netstat -o | grep   I see that when the delay is only 1ms the 
receive queue fills up, when it shows a high number ~3 the messages 
start appearing.

So this might be unrelated to gRPC itself but the sockets being overloaded?

-- 
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/6db0dbff-6194-400c-9641-70bab9a664d2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[grpc-io] Stress test error: 'ignoring out of order new grpc_chttp2_stream request on server'

2016-11-10 Thread Okke Hendriks
Hello,

I am doing a stress test:

   - 50 clients each doing 5000 async requests.
   - There is 1ms between each async call.
   - The service is a simple return of the requests message.
   - The request are being processed by an simple asynchronous API gRPC 
   server doing nothing else as processing the test requests. 
   - All traffic is via localhost.
   - gRPC C++ 1.0.0
   

I am, sometimes and usually after a while into the run, getting the 
following message a lot:

** more output here
E1110 18:02:45.561700666   57211 parsing.c:801]  ignoring out 
of order new grpc_chttp2_stream request on server; last grpc_chttp2_stream 
id=, new grpc_chttp2_stream id=9995
E1110 18:02:45.561863408   57211 parsing.c:801]  ignoring out 
of order new grpc_chttp2_stream request on server; last grpc_chttp2_stream 
id=, new grpc_chttp2_stream id=9997
E1110 18:02:46.309517548   56746 parsing.c:801]  ignoring out 
of order new grpc_chttp2_stream request on server; last grpc_chttp2_stream 
id=3807, new grpc_chttp2_stream id=2385
E1110 18:02:46.309809566   56746 parsing.c:801]  ignoring out 
of order new grpc_chttp2_stream request on server; last grpc_chttp2_stream 
id=3807, new grpc_chttp2_stream id=2387
E1110 18:02:46.310132458   56746 parsing.c:801]  ignoring out 
of order new grpc_chttp2_stream request on server; last grpc_chttp2_stream 
id=3807, new grpc_chttp2_stream id=2389
E1110 18:02:46.310476893   56746 parsing.c:801]  ignoring out 
of order new grpc_chttp2_stream request on server; last grpc_chttp2_stream 
id=3807, new grpc_chttp2_stream id=2391
E1110 18:02:46.310763893   56746 parsing.c:801]  ignoring out 
of order new grpc_chttp2_stream request on server; last grpc_chttp2_stream 
id=3807, new grpc_chttp2_stream id=2393
E1110 18:02:46.311340403   56746 parsing.c:801]  ignoring out 
of order new grpc_chttp2_stream request on server; last grpc_chttp2_stream 
id=3807, new grpc_chttp2_stream id=2395
E1110 18:02:46.311623344   56746 parsing.c:801]  ignoring out 
of order new grpc_chttp2_stream request on server; last grpc_chttp2_stream 
id=3807, new grpc_chttp2_stream id=2397
E1110 18:02:46.312027031   56746 parsing.c:801]  ignoring out 
of order new grpc_chttp2_stream request on server; last grpc_chttp2_stream 
id=3807, new grpc_chttp2_stream id=3723
** more output here

What exactly does this imply? 
Is this expected, with this kind of stress? And if so what determines/are 
the limits?
Or is there something else which I should investigate going on?


-- 
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/0fb6a686-4130-4bbd-8ea2-4388565fccb9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[grpc-io] Why do I get a TimePoint2TimeSpec linker error

2016-09-20 Thread Okke Hendriks

In function 
`grpc::TimePoint > > 
>::TimePoint(std::chrono::time_point > > const&)':
prototype_a.cpp:(.text._ZN4grpc9TimePointINSt6chrono10time_pointINS1_3_V212system_clockENS1_8durationIlSt5ratioILl1ELl10EEEC2ERKS9_[_ZN4grpc9TimePointINSt6chrono10time_pointINS1_3_V212system_clockENS1_8durationIlSt5ratioILl1ELl10EEEC5ERKS9_]+0x1f):
 
undefined reference to `grpc::Timepoint2Timespec(std::chrono::time_point > > const&, gpr_timespec*)'
collect2: error: ld returned 1 exit status

I am getting the above linker error when adding the following lines to my 
'procom' library.

std::chrono::system_clock::time_point 
deadline(std::chrono::system_clock::now() + std::chrono::seconds(10));
_channel->WaitForConnected(deadline);

I am linking 'procom' with the following CMake commands:

add_library(procom SHARED src/procom.cpp)
target_link_libraries(procom pthread ${ZLIB_LIBRARIES} libgpr.a libgrpc++
_unsecure.a libgrpc_unsecure.a libprotobuf.a)

Which I am using later on in a 'prototype_a' application, which is being 
build with the following CMake commands:

add_executable(proto_a src/prototype/prototype_a.cpp)
target_link_libraries(proto_a procom)

I would appreciate it very much if someone has an idea of what I am doing 
wrong? :)
Thank you in advance!

-- 
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/a4e8a14f-b06b-4a3b-80d0-73648bb0e954%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.