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
Is your feature request related to a problem? Please describe.
When there is cancellation during reading from stream, two log messages of "fail" level are emitted. This happens for any request that returns stream.
var cancellationTokenSource = new CancellationTokenSource(5000);
var client = new MetadataService.MetadataServiceClient(_channel);
using var subscription = client.WatchChanges(new Empty()); // this is just for demonstration, I don't think proto is necessary
await foreach (var change in subscription.ResponseStream.ReadAllAsync(cancellationTokenSource.Token))
{
Console.WriteLine(change.Elements.Count);
}
fail: Grpc.Net.Client.Internal.GrpcCall[17]
Error reading message.
System.Threading.Tasks.TaskCanceledException: The operation was canceled.
at System.Net.Http.CancellationHelper.ThrowOperationCanceledException(Exception innerException, CancellationToken cancellationToken)
at System.Net.Http.CancellationHelper.ThrowIfCancellationRequested(CancellationToken cancellationToken)
at System.Net.Http.Http2Connection.Http2Stream.GetCancelableWaiterTask(CancellationToken cancellationToken)
at System.Net.Http.Http2Connection.Http2Stream.ReadDataAsync(Memory`1 buffer, HttpResponseMessage responseMessage, CancellationToken cancellationToken)
at Grpc.Net.Client.StreamExtensions.ReadMessageAsync[TResponse](Stream responseStream, ILogger logger, Func`2 deserializer, String grpcEncoding, Nullable`1 maximumMessageSize, Dictionary`2 compressionProviders, Boolean singleMessage, CancellationToken cancellationToken)
fail: Grpc.Net.Client.Internal.GrpcCall[3]
Call failed with gRPC error status. Status code: 'Cancelled', Message: 'gRPC call disposed.'.
Describe the solution you'd like
I believe cancelling should not have 'fail' severity - I suggest debug is enough. This issue floods my logs on shutdown of the service, and I find it annoying.
Fixing this specific instance is pretty easy and I can PR it, I would, however, like, to suggest some more organized effort in graceful handling of cancellation.
Describe alternatives you've considered
Grpc.Core does not suffer from this flaw. I switched, for client, to Grpc.Core for now.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
When there is cancellation during reading from stream, two log messages of "fail" level are emitted. This happens for any request that returns stream.
Describe the solution you'd like
I believe cancelling should not have 'fail' severity - I suggest debug is enough. This issue floods my logs on shutdown of the service, and I find it annoying.
Fixing this specific instance is pretty easy and I can PR it, I would, however, like, to suggest some more organized effort in graceful handling of cancellation.
Describe alternatives you've considered
Grpc.Core does not suffer from this flaw. I switched, for client, to Grpc.Core for now.
The text was updated successfully, but these errors were encountered: