C# Grpc client hangs

Skip to first unread message


May 8, 2017, 4:30:48 PM5/8/17
to grpc.io

I am investigating a problem I am facing. My setup is as follows. The client and server are both written in C#. I am running the test on Windows 10. 

The service is very simple. It sleeps for given duration and returns the text that was sent it.
The client is a command line program that opens a channel and calls the service a given number of times and then exits.

The test is as follows:

In one session I start a client with a sleep parameter of 30000 millisecs.

In another session I start a client with sleep parameter of 10 millisecs, and iteration parameter of 10.
I repeatedly start the client in the second session in sequence - i.e. once the client exits I restart it.

What I notice is this:

In the second session the client completes successfully (i.e. calls the service 10 time) the first few times it is called. Then at the next invocation it just hangs at the first call until the client in the first session finishes. 

My feeling is that it is something to do with Channels? Each time the client is started, it creates a channel and does 10 calls to the server. Once the channel is established the calls go through fine. But I do not understand why the 3rd or 4th client invocation just hangs until the client in the first session completes. 

Any hints on what the issue might be? 

I will create a small test case to show the problem - currently it is part of a larger project so it will take a little time to setup a standalone test.

Thanks and Regards


May 8, 2017, 5:27:58 PM5/8/17
to grpc.io, mob...@majumdar.org.uk
Adding some more information.

I am using grpc 1.2.2.

I ran the client in the debugger and when it blocked I saw that the stack trace showed that it blocks at:

Grpc.Core.dll!Grpc.Core.Internal.CompletionQueueSafeHandle.Pluck(System.IntPtr tag) Unknown
  Grpc.Core.dll!Grpc.Core.Internal.AsyncCall<Request, Response>.UnaryCall(Request msg) Unknown
  Grpc.Core.dll!Grpc.Core.DefaultCallInvoker.BlockingUnaryCall<Request, Response>(Grpc.Core.Method<Request, Response> method, string host, Grpc.Core.CallOptions options, Request request) Unknown
  Grpc.Core.dll!Grpc.Core.Internal.InterceptingCallInvoker.BlockingUnaryCall<Request, Response>(Grpc.Core.Method<Request, Response> method, string host, Grpc.Core.CallOptions options, Request request) Unknown

Not sure what this means though. 

Thanks and Regards


May 8, 2017, 6:03:03 PM5/8/17
to grpc.io, mob...@majumdar.org.uk
Just to report that the client hangs randomly - i.e. it may be the 4th invocation or 9th invocation. I wanted to clarify that it is not predictable which invocation will hang.

On Monday, 8 May 2017 21:30:48 UTC+1, mob...@majumdar.org.uk wrote:

Dibyendu Majumdar

May 8, 2017, 7:41:43 PM5/8/17
to grpc.io
Issue raised:

Test project that reproduces the problem:
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "grpc.io" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/grpc-io/1t5UC8lPnxs/unsubscribe.
> To unsubscribe from this group and all its topics, 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/94f2bd55-514e-4957-8770-67e7db98f4b6%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

deepa udgire

May 5, 2022, 8:10:55 AMMay 5
to grpc.io
Hello Dibyendu , 

Were you able to solve the issue , i see a simillar case with my project , where it fails at 
2022-04-29T20:30:41.363194Z fct-0a [err] ERR[17564]:  TAS:(pid:17564) #9 0x7f2246b48965 in grpc_completion_queue_pluck+0x4b from /usr/lib64/libTpl.so+0x40c965

2022-04-29T20:30:41.363394Z fct-0a [err] ERR[17564]:  TAS:(pid:17564) #10 0x7f2246b08ecb in _ZN4grpc11CoreCodegen27grpc_completion_queue_pluckEP21grpc_completion_queuePv12gpr_timespecS3_+0x4b from /usr/lib64/libTpl.so+0x3ccecb

2022-04-29T20:30:41.364778Z fct-0a [err] ERR[17564]:  TAS:(pid:17564) #11 0x7f2247f12356 in _ZN4grpc15CompletionQueue5PluckEPNS_18CompletionQueueTagE+0x46 from /usr/lib64/libTpiProto.so+0x120c356

Can you please guide for a quickest possible solution.
Reply all
Reply to author
0 new messages