|
|
@ -626,6 +626,14 @@ namespace Grpc.Core.Internal |
|
|
|
if (status.StatusCode != StatusCode.OK) |
|
|
|
if (status.StatusCode != StatusCode.OK) |
|
|
|
{ |
|
|
|
{ |
|
|
|
streamingResponseCallFinishedTcs.SetException(new RpcException(status, receivedStatus.Trailers)); |
|
|
|
streamingResponseCallFinishedTcs.SetException(new RpcException(status, receivedStatus.Trailers)); |
|
|
|
|
|
|
|
if (status.StatusCode == StatusCode.Cancelled) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
// Make sure the exception set to the Task is observed, |
|
|
|
|
|
|
|
// otherwise this can trigger "Unobserved exception" when the response stream |
|
|
|
|
|
|
|
// is not read until its end and the task created by the TCS is garbage collected. |
|
|
|
|
|
|
|
// See https://github.com/grpc/grpc/issues/17458 |
|
|
|
|
|
|
|
var _ = streamingResponseCallFinishedTcs.Task.Exception; |
|
|
|
|
|
|
|
} |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|