grpc-dotnet icon indicating copy to clipboard operation
grpc-dotnet copied to clipboard

dev: Grpc.Net.Client throws System.Net.Http.HttpIOException

Open KirillKurdyukov opened this issue 7 months ago • 3 comments

Unhandled exception. System.Net.Http.HttpIOException: The response ended prematurely while waiting for the next frame from the server. (ResponseEnded)
   at System.Net.Http.Http2Connection.ThrowRequestAborted(Exception innerException)
   at System.Net.Http.Http2Connection.Http2Stream.SendDataAsync(ReadOnlyMemory`1 buffer, CancellationToken cancellationToken)
   at Grpc.Net.Client.Internal.StreamExtensions.WriteMessageAsync[TMessage](Stream stream, GrpcCall call, TMessage message, Action`2 serializer, CallOptions callOptions)
   at Grpc.Net.Client.Internal.HttpContentClientStreamWriter`2.WriteAsyncCore[TState](Func`5 writeFunc, TState state, CancellationToken cancellationToken)
   at Grpc.Net.Client.Internal.HttpContentClientStreamWriter`2.WriteCoreAsync(TRequest message, CancellationToken cancellationToken)

Should Grpc.Net.Client throw non-RPC errors?

KirillKurdyukov avatar Jun 11 '25 15:06 KirillKurdyukov

In some circumstances it does.

JamesNK avatar Jun 11 '25 22:06 JamesNK

Are you planning to fix this? @JamesNK

Can I at least rely on public class HttpIOException: System.IO.IOException?

KirillKurdyukov avatar Jun 18 '25 13:06 KirillKurdyukov

HttpIOException looks like an unavailable status, but it loses the guarantees of what to expect.

:((

KirillKurdyukov avatar Jun 18 '25 14:06 KirillKurdyukov