[grpc-io] Re: gRPC python behaves differently from WINE Python vs Linux Python

2022-01-10 Thread John Forensics
I created a PR for this:

https://github.com/grpc/grpc/pull/28506


Op donderdag 6 januari 2022 om 15:02:11 UTC+1 schreef John Forensics:

> Still getting closed:
>
> On windows gRPC is handled using WSASend asynchronous IO. When reaching a 
> TCP congested situation WSASend should report  *WSAEWOULDBLOCK *however 
> in WINE, the gRPC usage of WSASend always reports "0" 
>
> grep "Ret  ws2_32.WSASend" /tmp/stderr | sort | uniq -c
>   1 0d4:Ret  ws2_32.WSASend() retval= ret=027f06db
>  36 00d0:Ret  ws2_32.WSASend() retval= ret=027f06db
>  15 00d4:Ret  ws2_32.WSASend() retval= ret=027f06db
>   1 gen00d0:Ret  ws2_32.WSASend() retval= ret=027f06db
>   1 _manager00d0:Ret  ws2_32.WSASend() retval= ret=027f06db
>   1 MES00d0:Ret  ws2_32.WSASend() retval= ret=027f06db
>
> Also all calls to WSASend have LPWSAOVERLAPPED and 
> LPWSAOVERLAPPED_COMPLETION_ROUTINE 
> set to zero.
>
> Call 
> ws2_32.WSASend(00fc,03cbf428,0001,03cbf40c,,,)
>  
> ret=027f06db
>
> int WSAAPI WSASend( [in] SOCKET s, [in] LPWSABUF lpBuffers, [in] DWORD 
> dwBufferCount, [out] LPDWORD lpNumberOfBytesSent, [in] DWORD dwFlags, [in] 
> LPWSAOVERLAPPED lpOverlapped, [in] LPWSAOVERLAPPED_COMPLETION_ROUTINE 
> lpCompletionRoutine );
>
> This matches the code in /src/core/lib/iomgr/tcp_windows.cc
>
>   /* First, let's try a synchronous, non-blocking write. */
>   status = WSASend(socket->socket, buffers, 
> (DWORD)tcp->write_slices->count,
>_sent, 0, NULL, NULL);
>   info->wsa_error = status == 0 ? 0 : WSAGetLastError();
>
>   /* We would kind of expect to get a WSAEWOULDBLOCK here, especially on a 
> busy
>  connection that has its send queue filled up. But if we don't, then 
> we can
>  avoid doing an async write operation at all. */
>   if (info->wsa_error != WSAEWOULDBLOCK) {
> grpc_error_handle error = status == 0
>   ? GRPC_ERROR_NONE
>   : GRPC_WSA_ERROR(info->wsa_error, 
> "WSASend");
> grpc_core::ExecCtx::Run(DEBUG_LOCATION, cb, error);
> if (allocated) gpr_free(allocated);
> return;
>   }
>
>
> So the "dispute" for this API probably is, is WSASend on Overlapped IO 
> allowed to send partially and report the lpNumberOfBytesSent < number of 
> bytes in the buffer.
>
> Anyone got a opinion about that?
>
>
> Op woensdag 5 januari 2022 om 16:53:34 UTC+1 schreef John Forensics:
>
>>
>> Could one of the developers please elaborate on the case where:
>> * The sender has been blocked (shortly) on a closed TCP Window leaving a 
>> large set of gRPC chunks waiting at the HTTP2 stream sender side
>> * The receiver has not send a OUTBOUND WINDOW_UPDATE to signal its OK to 
>> send more data.
>>
>> My current impression is that the python (sender) will not continue 
>> sending although the TCP Congestion window is open again.
>>
>>
>> Op woensdag 5 januari 2022 om 14:52:09 UTC+1 schreef John Forensics:
>>
>>> So the stream is stalled as the congestion window is closed. Just 
>>> verified with tcpdump and tcptrace, and can confirm thats the problem.
>>>
>>>
>>> https://github.com/grpc/grpc/blob/2e3e3ccc3d5c40010a6ad6f824a5024176a7/src/core/ext/transport/chttp2/transport/writing.cc#L449
>>>
>>> This explains why excessive logging and making my program inefficient 
>>> helps (e.g. adding debug logging of gRPC itself).
>>>
>>> Which changes the question: why isn't the stream unstalled when the 
>>> congestion-window opens again..
>>>
>>> This also seems something that would be different in terms of low level 
>>> API  in Linux, Windows and WINE.
>>>
>>> Op woensdag 5 januari 2022 om 14:32:20 UTC+1 schreef John Forensics:
>>>
 After sending some data (about 4 chunks of 16k of a single 1Mb gRPC 
 message)  the HTTP2-stream seems to be put on the "stalled" list. 
 (Whatever 
 that may be). 


  World.Hello World.Hello World.Hello World.Hello 
 World.Hello World.Hello World.Hello World.Hello 
 World.Hello World.Hello World.Hello World.Hello 
 World.Hello W
 orld.Hello World.Hello World.Hello World.Hello 
 World.Hello World.Hello World.Hello World.Hello 
 World.Hello World.Hello World.Hello World.Hello 
 World.Hello Worl
 d.Hello World.Hello World.Hello World.Hello 
 World.Hello World.Hello World.Hello World.'
 I0105 12:30:25.21800   216 src/core/lib/iomgr/timer_generic.cc:558] 
   .. shard[13] popped 0
 I0105 12:30:25.25800   208 
 src/core/lib/surface/completion_queue.cc:1074] RETURN_EVENT[00484AA0]: 
 QUEUE_TIMEOUT
 I0105 12:30:25.26700   212 src/core/lib/iomgr/executor.cc:294] 
 EXECUTOR (default-executor) try to schedule 00499258 (short) to thread 0
 I0105 12:30:25.26700   216 

[grpc-io] Repository for DENO's GRPC.

2022-01-10 Thread Fabio Andres Pino Gutierrez
Im interesting to start to create a project for integrate grpc to deno like 
a third party module for deno, im interesting to know the framework with 
witch language already is supported today with node.js, cuz i suppose the 
integration will be like right now is with node.js

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/173976df-a39f-4d5f-9554-a8dd0547359dn%40googlegroups.com.


Re: [grpc-io] keep channel alive without activity

2022-01-10 Thread 'Sanjay Pujare' via grpc.io
Check this
https://stackoverflow.com/questions/66818645/http2-ping-frames-over-aws-alb-grpc-keepalive-ping

"*ALB does not support the HTTP2 ping frames*."

On Mon, Jan 10, 2022 at 12:16 PM Rajat Goyal 
wrote:

> ALB is configured with idle-timeout - 5 minutes.
> I configured bi-di client with :
>  keepAliveWithoutCalls(true).keepAliveTime(90,
> TimeUnit.SECONDS).keepAliveTimeout(10, TimeUnit.SECONDS)
> while server is configured with :
> permitKeepAliveWithoutCalls(true).permitKeepAliveTime(1, TimeUnit.MINUTES)
>
> But I received INTERNAL: HTTP/2 error code: PROTOCOL_ERROR Received Rst
> Stream after exactly 5 minutes. Which looks like ALB has dropped the
> connection after 5 minutes.
>
> Any idea how we can keep idle connection alive ?
>
>
>
> On Mon, Jan 10, 2022 at 10:39 PM Rajat Goyal 
> wrote:
>
>> Hi Sanjay,
>>
>>  I see that bi-directional streamObserver object gets call back
>> onError() in case of any error in network.
>>
>> Isn't that done by any heartbeat mechanism already?. If so, then
>> connection at ALB should be active with these ping-pong packets ?
>>
>> Regards,
>> Rajat
>>
>> On Mon, 10 Jan, 2022, 10:33 pm Sanjay Pujare, 
>> wrote:
>>
>>> This may probably help?
>>> https://grpc.io/blog/grpc-on-http2/#keeping-connections-alive ?
>>>
>>> On Mon, Jan 10, 2022 at 8:54 AM Rajat Goyal 
>>> wrote:
>>>
 Hi,

   Gentle reminder for any resolution for above.

 Regards,
 Rajat

 On Sun, 9 Jan, 2022, 6:50 pm Rajat Goyal, 
 wrote:

> Hi,
>
>  We have a system where clients open bi-directional grpc stream to
> ALB, which proxies to one of active server. So
>
>  bi-di
> client <>  ALB  <> server
>
> In-case of any failure of connection, clients re-connects to us as we
> want to keep a bi-di channel open.
>
> Question is : How can we keep the channel open even if there is no
> activity for sometime. ALB are configured with 300 sec idle-timeout which
> means it will drop the connection if no packets are exchanged in 300 sec.
>
> As we want to keep the connection open as much possible ( only
> re-create in-case of any issue),  and not let it die due to idle timeout,
> what properties should server can client set ?
> Should keep-alive setting at both client & server help out ?
>
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/grpc-io/532f5551-e978-467e-b71c-0031a54953bfn%40googlegroups.com
> 
> .
>
 --
 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 view this discussion on the web visit
 https://groups.google.com/d/msgid/grpc-io/CALO6TtuVMUxHQmZMGj1wvD7r4qvRQuKd2gy0j%2B0z8b8EYdw7BA%40mail.gmail.com
 
 .

>>>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/CA%2BPad6gSsVNn67rThtbs2VkoGjFo%3DRe5nWCgNXNJ-N3L73zz8A%40mail.gmail.com.


Re: [grpc-io] keep channel alive without activity

2022-01-10 Thread Rajat Goyal
ALB is configured with idle-timeout - 5 minutes.
I configured bi-di client with :
 keepAliveWithoutCalls(true).keepAliveTime(90,
TimeUnit.SECONDS).keepAliveTimeout(10, TimeUnit.SECONDS)
while server is configured with :
permitKeepAliveWithoutCalls(true).permitKeepAliveTime(1, TimeUnit.MINUTES)

But I received INTERNAL: HTTP/2 error code: PROTOCOL_ERROR Received Rst
Stream after exactly 5 minutes. Which looks like ALB has dropped the
connection after 5 minutes.

Any idea how we can keep idle connection alive ?



On Mon, Jan 10, 2022 at 10:39 PM Rajat Goyal 
wrote:

> Hi Sanjay,
>
>  I see that bi-directional streamObserver object gets call back
> onError() in case of any error in network.
>
> Isn't that done by any heartbeat mechanism already?. If so, then
> connection at ALB should be active with these ping-pong packets ?
>
> Regards,
> Rajat
>
> On Mon, 10 Jan, 2022, 10:33 pm Sanjay Pujare, 
> wrote:
>
>> This may probably help?
>> https://grpc.io/blog/grpc-on-http2/#keeping-connections-alive ?
>>
>> On Mon, Jan 10, 2022 at 8:54 AM Rajat Goyal 
>> wrote:
>>
>>> Hi,
>>>
>>>   Gentle reminder for any resolution for above.
>>>
>>> Regards,
>>> Rajat
>>>
>>> On Sun, 9 Jan, 2022, 6:50 pm Rajat Goyal, 
>>> wrote:
>>>
 Hi,

  We have a system where clients open bi-directional grpc stream to
 ALB, which proxies to one of active server. So

  bi-di
 client <>  ALB  <> server

 In-case of any failure of connection, clients re-connects to us as we
 want to keep a bi-di channel open.

 Question is : How can we keep the channel open even if there is no
 activity for sometime. ALB are configured with 300 sec idle-timeout which
 means it will drop the connection if no packets are exchanged in 300 sec.

 As we want to keep the connection open as much possible ( only
 re-create in-case of any issue),  and not let it die due to idle timeout,
 what properties should server can client set ?
 Should keep-alive setting at both client & server help out ?


 --
 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 view this discussion on the web visit
 https://groups.google.com/d/msgid/grpc-io/532f5551-e978-467e-b71c-0031a54953bfn%40googlegroups.com
 
 .

>>> --
>>> 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 view this discussion on the web visit
>>> https://groups.google.com/d/msgid/grpc-io/CALO6TtuVMUxHQmZMGj1wvD7r4qvRQuKd2gy0j%2B0z8b8EYdw7BA%40mail.gmail.com
>>> 
>>> .
>>>
>>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/CALO6TtubX_RuPCzzWs_FA0Mk0b_h2NM%2BAcUdrdZAL3RH4JNTMA%40mail.gmail.com.


Re: [grpc-io] keep channel alive without activity

2022-01-10 Thread Rajat Goyal
Hi Sanjay,

 I see that bi-directional streamObserver object gets call back
onError() in case of any error in network.

Isn't that done by any heartbeat mechanism already?. If so, then connection
at ALB should be active with these ping-pong packets ?

Regards,
Rajat

On Mon, 10 Jan, 2022, 10:33 pm Sanjay Pujare, 
wrote:

> This may probably help?
> https://grpc.io/blog/grpc-on-http2/#keeping-connections-alive ?
>
> On Mon, Jan 10, 2022 at 8:54 AM Rajat Goyal 
> wrote:
>
>> Hi,
>>
>>   Gentle reminder for any resolution for above.
>>
>> Regards,
>> Rajat
>>
>> On Sun, 9 Jan, 2022, 6:50 pm Rajat Goyal, 
>> wrote:
>>
>>> Hi,
>>>
>>>  We have a system where clients open bi-directional grpc stream to
>>> ALB, which proxies to one of active server. So
>>>
>>>  bi-di
>>> client <>  ALB  <> server
>>>
>>> In-case of any failure of connection, clients re-connects to us as we
>>> want to keep a bi-di channel open.
>>>
>>> Question is : How can we keep the channel open even if there is no
>>> activity for sometime. ALB are configured with 300 sec idle-timeout which
>>> means it will drop the connection if no packets are exchanged in 300 sec.
>>>
>>> As we want to keep the connection open as much possible ( only re-create
>>> in-case of any issue),  and not let it die due to idle timeout, what
>>> properties should server can client set ?
>>> Should keep-alive setting at both client & server help out ?
>>>
>>>
>>> --
>>> 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 view this discussion on the web visit
>>> https://groups.google.com/d/msgid/grpc-io/532f5551-e978-467e-b71c-0031a54953bfn%40googlegroups.com
>>> 
>>> .
>>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/grpc-io/CALO6TtuVMUxHQmZMGj1wvD7r4qvRQuKd2gy0j%2B0z8b8EYdw7BA%40mail.gmail.com
>> 
>> .
>>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/CALO6TttDw2qA7BTQo642ZmVZjZGfarM%3DkK_%3DOc64zJaqRb5-1A%40mail.gmail.com.


Re: [grpc-io] keep channel alive without activity

2022-01-10 Thread 'Sanjay Pujare' via grpc.io
This may probably help?
https://grpc.io/blog/grpc-on-http2/#keeping-connections-alive ?

On Mon, Jan 10, 2022 at 8:54 AM Rajat Goyal 
wrote:

> Hi,
>
>   Gentle reminder for any resolution for above.
>
> Regards,
> Rajat
>
> On Sun, 9 Jan, 2022, 6:50 pm Rajat Goyal, 
> wrote:
>
>> Hi,
>>
>>  We have a system where clients open bi-directional grpc stream to
>> ALB, which proxies to one of active server. So
>>
>>  bi-di
>> client <>  ALB  <> server
>>
>> In-case of any failure of connection, clients re-connects to us as we
>> want to keep a bi-di channel open.
>>
>> Question is : How can we keep the channel open even if there is no
>> activity for sometime. ALB are configured with 300 sec idle-timeout which
>> means it will drop the connection if no packets are exchanged in 300 sec.
>>
>> As we want to keep the connection open as much possible ( only re-create
>> in-case of any issue),  and not let it die due to idle timeout, what
>> properties should server can client set ?
>> Should keep-alive setting at both client & server help out ?
>>
>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/grpc-io/532f5551-e978-467e-b71c-0031a54953bfn%40googlegroups.com
>> 
>> .
>>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/grpc-io/CALO6TtuVMUxHQmZMGj1wvD7r4qvRQuKd2gy0j%2B0z8b8EYdw7BA%40mail.gmail.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/CA%2BPad6j43bytnoip4j-CgvrE3R7TQP-UmEWUO6HGgPihK9DqvQ%40mail.gmail.com.


Re: [grpc-io] keep channel alive without activity

2022-01-10 Thread Rajat Goyal
Hi,

  Gentle reminder for any resolution for above.

Regards,
Rajat

On Sun, 9 Jan, 2022, 6:50 pm Rajat Goyal, 
wrote:

> Hi,
>
>  We have a system where clients open bi-directional grpc stream to
> ALB, which proxies to one of active server. So
>
>  bi-di
> client <>  ALB  <> server
>
> In-case of any failure of connection, clients re-connects to us as we want
> to keep a bi-di channel open.
>
> Question is : How can we keep the channel open even if there is no
> activity for sometime. ALB are configured with 300 sec idle-timeout which
> means it will drop the connection if no packets are exchanged in 300 sec.
>
> As we want to keep the connection open as much possible ( only re-create
> in-case of any issue),  and not let it die due to idle timeout, what
> properties should server can client set ?
> Should keep-alive setting at both client & server help out ?
>
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/grpc-io/532f5551-e978-467e-b71c-0031a54953bfn%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/CALO6TtuVMUxHQmZMGj1wvD7r4qvRQuKd2gy0j%2B0z8b8EYdw7BA%40mail.gmail.com.