Some more info on the issue. I looked at Grpc library code in order to get 
some clarity on the issue. We are using Grpc v2.23 whose commit id is 
2b5f41f0be193d97467c3ec5280e269a49d75f8c. 

[1] is the code that throws the exception. It looks at flags and checks it 
against expected values [2]. The code [3] that provides the flag to the low 
level code sets it to default (0) if none is provided by the caller. We 
have tried both cases i.e. (1) setting the value to one of expected values 
or (2) not setting at all. Both cases cause the same exception. I'm unable 
to reason as to why would library throw an exception

[1] 
https://github.com/grpc/grpc/blob/2b5f41f0be193d97467c3ec5280e269a49d75f8c/src/core/lib/surface/call.cc
  
(line: 1644)
[2] 
https://github.com/grpc/grpc/blob/2b5f41f0be193d97467c3ec5280e269a49d75f8c/include/grpc/impl/codegen/grpc_types.h
 
(line: 445)
[3] 
https://github.com/grpc/grpc/blob/2b5f41f0be193d97467c3ec5280e269a49d75f8c/src/csharp/Grpc.Core/Internal/ServerResponseStream.cs
 
(line: 64)

We are using .Net v4.5.2.
Instances where we see the exception are running Windows2019 vs instances 
where we don't the issue are running Windows2016.
Hoping to get some pointers from the grpc experts community.

Thanks,
Farhan

On Monday, 18 April 2022 at 13:29:51 UTC-7 Farhan wrote:

> Hi Grpc experts,
>
> <https://stackoverflow.com/posts/71916682/timeline>
>
> I have a Bidirectional streaming application where sometimes server stream 
> is unable to send any messages to any clients. The error message that I get 
> is below. I have tried closing server's ReadStream in order to make client 
> re-establish the connection, but it doesn't help with the error and the 
> issue remains. The IServerStreamWriter::WriteAsync API doesn't take any 
> flags from the caller so I have no idea which flag is invalid.
>
>
> (Inner Exception #0) System.InvalidOperationException: Call error: 
> InvalidFlags at Grpc.Core.Internal.CallErrorExtensions.CheckOk(CallError 
> callError) at 
> Grpc.Core.Internal.CallSafeHandle.StartSendMessage(ISendCompletionCallback 
> callback, Byte[] payload, WriteFlags writeFlags, Boolean 
> sendEmptyInitialMetadata) at 
> Grpc.Core.Internal.AsyncCallBase`2.SendMessageInternalAsync(TWrite 
> msg, WriteFlags writeFlags) at 
> Grpc.Core.Internal.ServerResponseStream`2.WriteAsync(TResponse 
> message)
>
>
> I'm hoping to get some pointers on what might be happening?
>
> Thanks,
>
> Farhan
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/4a7bf70c-d16b-4692-8032-7658b5f8b81fn%40googlegroups.com.

Reply via email to