You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Scenario: the server (native in this case) deliberately faults with an RpcException including some trailers in the middle of a server-streaming operation, and that trailer has also been added to the server context, i.e.
The client-side call await streamReader.MoveNext(cancellationToken) will surface an RpcException with the correct StatusCode, Detail and Trailers i.e. one of "sum", sum
Actual
as observed with Grpc-Dotnet
The client-side call await streamReader.MoveNext(cancellationToken) surfaces an RpcException with the correct StatusCode, Detail - but:
sometimes the Trailers collection is empty
sometimes the Trailers collection has it twice, i.e. "sum", "10,10"
I haven't figured out the rules for when it is empty and when it is duplicated; when I run just the one test, it tends to be empty; when I run a bunch of tests it tends to be duplicated. Possibly a thread race condition.
Repro
See the ServerStreaming(true) test case here - comparing NativeStreamTests to ManagedStreamTests.
A good place to put a breakpoint is in Reshape.cs, ServerStreamingAsyncImpl, on the line:
metadata?.SetTrailers(fault);
(which is where the exception is surfaced)
Note that this is the exact same (native) server in both tests, so presumably this is a client bug.
Note: I have added IsManagedClient that changes the test's expectation to reflect what I am observing (so my tests acknowledge reality for now)
The text was updated successfully, but these errors were encountered:
mgravell
changed the title
Client: server-streaming does not collect trailers during an RpcException
Client: server-streaming does not collect duplicated (fault+ctx) trailers during an RpcException
May 20, 2020
Scenario: the server (native in this case) deliberately faults with an
RpcException
including some trailers in the middle of a server-streaming operation, and that trailer has also been added to the server context, i.e.Expectation
as observed with the native Google client:
The client-side call
await streamReader.MoveNext(cancellationToken)
will surface anRpcException
with the correctStatusCode
,Detail
andTrailers
i.e. one of"sum", sum
Actual
as observed with Grpc-Dotnet
The client-side call
await streamReader.MoveNext(cancellationToken)
surfaces anRpcException
with the correctStatusCode
,Detail
- but:Trailers
collection is emptyTrailers
collection has it twice, i.e."sum", "10,10"
I haven't figured out the rules for when it is empty and when it is duplicated; when I run just the one test, it tends to be empty; when I run a bunch of tests it tends to be duplicated. Possibly a thread race condition.
Repro
See the
ServerStreaming(true)
test case here - comparingNativeStreamTests
toManagedStreamTests
.A good place to put a breakpoint is in
Reshape.cs
,ServerStreamingAsyncImpl
, on the line:(which is where the exception is surfaced)
Note that this is the exact same (native) server in both tests, so presumably this is a client bug.
Note: I have added
IsManagedClient
that changes the test's expectation to reflect what I am observing (so my tests acknowledge reality for now)The text was updated successfully, but these errors were encountered: