-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Closed
Description
The server is completing the response stream and then sending RST_STREAM frame.
The client should be able to read the response to the end without error. Instead, they are getting an error.
This is from a flakey test. This is the only time I've seen it fail.
WriteMessageAfterDeadline
Source: DeadlineTests.cs line 114
Duration: 218 ms
Message:
System.IO.IOException : The request was aborted.
----> System.Net.Http.Http2ConnectionException : The HTTP/2 server sent invalid data on the connection. HTTP/2 error code 'PROTOCOL_ERROR' (0x1).
Stack Trace:
Http2Connection.ThrowRequestAborted(Exception innerException)
Http2Stream.CheckResponseBodyState()
Http2Stream.TryReadFromBuffer(Span`1 buffer, Boolean partOfSyncRead)
Http2Stream.ReadDataAsync(Memory`1 buffer, HttpResponseMessage responseMessage, CancellationToken cancellationToken)
StreamPipeReader.<ReadAsync>g__Core|36_0(StreamPipeReader reader, CancellationTokenSource tokenSource, CancellationToken cancellationToken)
PipeExtensions.ReadStreamMessageAsync[T](PipeReader input, HttpContextServerCallContext serverCallContext, Func`2 deserializer, CancellationToken cancellationToken) line 268
TaskExtensions.TimeoutAfter[T](Task`1 task, TimeSpan timeout, String filePath, Int32 lineNumber) line 72
MessageHelpers.AssertReadStreamMessageAsync[T](PipeReader pipeReader, String compressionEncoding, List`1 compressionProviders) line 102
TaskExtensions.TimeoutAfter[T](Task`1 task, TimeSpan timeout, String filePath, Int32 lineNumber) line 72
<<WriteMessageAfterDeadline>b__2>d.MoveNext() line 187
--- End of stack trace from previous location ---
TaskExtensions.TimeoutAfter(Task task, TimeSpan timeout, String filePath, Int32 lineNumber) line 96
DeadlineTests.WriteMessageAfterDeadline() line 202
GenericAdapter`1.BlockUntilCompleted()
NoMessagePumpStrategy.WaitForCompletion(AwaitAdapter awaiter)
AsyncToSyncAdapter.Await(Func`1 invoke)
TestMethodCommand.RunTestMethod(TestExecutionContext context)
TestMethodCommand.Execute(TestExecutionContext context)
<>c__DisplayClass1_0.<Execute>b__0()
BeforeAndAfterTestCommand.RunTestMethodInThreadAbortSafeZone(TestExecutionContext context, Action action)
--Http2ConnectionException
Http2Connection.ThrowProtocolError(Http2ProtocolErrorCode errorCode)
RttEstimator.OnPingAckReceived(Int64 payload, Http2Connection connection)
Http2Connection.ProcessPingFrame(FrameHeader frameHeader)
Http2Connection.ProcessIncomingFramesAsync()
Standard Output:
0.000s GrpcTestContext - Information: Starting DeadlineTests.WriteMessageAfterDeadline
0.001s SERVER Grpc.AspNetCore.Server.Model.Internal.ServiceRouteBuilder - Trace: Discovering gRPC methods for FunctionalTestsWebsite.Infrastructure.DynamicService.
0.002s SERVER Grpc.AspNetCore.Server.Model.Internal.BinderServiceMethodProvider - Debug: Could not find bind method for FunctionalTestsWebsite.Infrastructure.DynamicService.
0.002s SERVER Grpc.AspNetCore.Server.Model.Internal.ServiceRouteBuilder - Trace: Added gRPC method 'WriteUntilError' to service 'DynamicService'. Method type: 'ServerStreaming', route pattern: '/DynamicService/WriteUntilError'.
0.004s SERVER Microsoft.AspNetCore.Server.Kestrel.Connections - Debug: Connection id "0HMB1REBPPE4G" accepted.
0.004s SERVER Microsoft.AspNetCore.Server.Kestrel.Connections - Debug: Connection id "0HMB1REBPPE4G" started.
0.004s SERVER Microsoft.AspNetCore.Server.Kestrel.Http2 - Trace: Connection id "0HMB1REBPPE4G" sending SETTINGS frame for stream ID 0 with length 18 and flags NONE.
0.004s SERVER Microsoft.AspNetCore.Server.Kestrel.Http2 - Trace: Connection id "0HMB1REBPPE4G" sending WINDOW_UPDATE frame for stream ID 0 with length 4 and flags 0x0.
0.004s SERVER Microsoft.AspNetCore.Server.Kestrel.Http2 - Trace: Connection id "0HMB1REBPPE4G" received SETTINGS frame for stream ID 0 with length 12 and flags NONE.
0.004s SERVER Microsoft.AspNetCore.Server.Kestrel.Http2 - Trace: Connection id "0HMB1REBPPE4G" sending SETTINGS frame for stream ID 0 with length 0 and flags ACK.
0.004s SERVER Microsoft.AspNetCore.Server.Kestrel.Http2 - Trace: Connection id "0HMB1REBPPE4G" received WINDOW_UPDATE frame for stream ID 0 with length 4 and flags 0x0.
0.004s SERVER Microsoft.AspNetCore.Server.Kestrel.Http2 - Trace: Connection id "0HMB1REBPPE4G" received HEADERS frame for stream ID 1 with length 90 and flags END_HEADERS.
0.004s SERVER Microsoft.AspNetCore.Server.Kestrel.Http2 - Trace: Connection id "0HMB1REBPPE4G" received DATA frame for stream ID 1 with length 12 and flags NONE.
0.004s SERVER Microsoft.AspNetCore.Server.Kestrel.Http2 - Trace: Connection id "0HMB1REBPPE4G" received DATA frame for stream ID 1 with length 0 and flags END_STREAM.
0.004s SERVER Microsoft.AspNetCore.Server.Kestrel.Http2 - Trace: Connection id "0HMB1REBPPE4G" received SETTINGS frame for stream ID 0 with length 0 and flags ACK.
0.004s SERVER Microsoft.AspNetCore.Hosting.Diagnostics - Information: Request starting HTTP/2 POST http://127.0.0.1:50050/DynamicService/WriteUntilError application/grpc -
0.004s SERVER Microsoft.AspNetCore.Routing.EndpointRoutingMiddleware - Debug: Request matched endpoint 'gRPC - /DynamicService/WriteUntilError'
0.005s SERVER Microsoft.AspNetCore.Routing.EndpointMiddleware - Information: Executing endpoint 'gRPC - /DynamicService/WriteUntilError'
0.005s SERVER Grpc.AspNetCore.Server.ServerCallHandler - Trace: Request deadline timeout of 00:00:00.2000000 started.
0.005s SERVER Grpc.AspNetCore.Server.ServerCallHandler - Debug: Reading message.
0.005s SERVER Microsoft.AspNetCore.Server.Kestrel - Debug: Connection id "0HMB1REBPPE4G", Request id "0HMB1REBPPE4G:00000001": started reading request body.
0.005s SERVER Microsoft.AspNetCore.Server.Kestrel - Debug: Connection id "0HMB1REBPPE4G", Request id "0HMB1REBPPE4G:00000001": done reading request body.
0.005s SERVER Grpc.AspNetCore.Server.ServerCallHandler - Trace: Deserializing 7 byte message to 'Greet.HelloRequest'.
0.005s SERVER Grpc.AspNetCore.Server.ServerCallHandler - Trace: Received message.
0.006s SERVER Microsoft.AspNetCore.Server.Kestrel.Http2 - Trace: Connection id "0HMB1REBPPE4G" sending HEADERS frame for stream ID 1 with length 59 and flags END_HEADERS.
0.006s SERVER Grpc.AspNetCore.Server.ServerCallHandler - Debug: Sending message.
0.006s SERVER Grpc.AspNetCore.Server.ServerCallHandler - Trace: Serialized 'Greet.HelloReply' to 22 byte message.
0.006s SERVER Microsoft.AspNetCore.Server.Kestrel.Http2 - Trace: Connection id "0HMB1REBPPE4G" sending DATA frame for stream ID 1 with length 27 and flags NONE.
0.006s SERVER Grpc.AspNetCore.Server.ServerCallHandler - Trace: Message sent.
0.006s SERVER Microsoft.AspNetCore.Server.Kestrel.Http2 - Trace: Connection id "0HMB1REBPPE4G" received PING frame for stream ID 0 with length 8 and flags NONE.
0.006s SERVER Microsoft.AspNetCore.Server.Kestrel.Http2 - Trace: Connection id "0HMB1REBPPE4G" sending PING frame for stream ID 0 with length 8 and flags ACK.
0.215s SERVER Grpc.AspNetCore.Server.ServerCallHandler - Debug: Request with timeout of 00:00:00.2000000 has exceeded its deadline.
0.216s SERVER Microsoft.AspNetCore.Server.Kestrel.Http2 - Trace: Connection id "0HMB1REBPPE4G" sending HEADERS frame for stream ID 1 with length 47 and flags END_STREAM, END_HEADERS.
0.216s SERVER Grpc.AspNetCore.Server.ServerCallHandler - Debug: Resetting response stream with error code 0.
0.216s SERVER Microsoft.AspNetCore.Server.Kestrel.Http2 - Debug: Trace id "0HMB1REBPPE4G:00000001": HTTP/2 stream error "NO_ERROR". A Reset is being sent to the stream.
Microsoft.AspNetCore.Connections.ConnectionAbortedException: The HTTP/2 stream was reset by the application with error code NO_ERROR.
0.216s SERVER Microsoft.AspNetCore.Server.Kestrel.Http2 - Trace: Connection id "0HMB1REBPPE4G" sending RST_STREAM frame for stream ID 1 with length 4 and flags 0x0.
0.217s SERVER Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets - Debug: Connection id "0HMB1REBPPE4G" reset.
0.217s SERVER Microsoft.AspNetCore.Server.Kestrel.Http2 - Debug: Connection id "0HMB1REBPPE4G" is closed. The last processed stream ID was 1.
0.217s SERVER Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets - Debug: Connection id "0HMB1REBPPE4G" sending FIN because: "The client closed the connection."
0.219s GrpcTestContext - Information: Finishing DeadlineTests.WriteMessageAfterDeadline
Important bit:
0.216s SERVER Microsoft.AspNetCore.Server.Kestrel.Http2 - Trace: Connection id "0HMB1REBPPE4G" sending HEADERS frame for stream ID 1 with length 47 and flags END_STREAM, END_HEADERS.
0.216s SERVER Grpc.AspNetCore.Server.ServerCallHandler - Debug: Resetting response stream with error code 0.
0.216s SERVER Microsoft.AspNetCore.Server.Kestrel.Http2 - Debug: Trace id "0HMB1REBPPE4G:00000001": HTTP/2 stream error "NO_ERROR". A Reset is being sent to the stream.
Microsoft.AspNetCore.Connections.ConnectionAbortedException: The HTTP/2 stream was reset by the application with error code NO_ERROR.
0.216s SERVER Microsoft.AspNetCore.Server.Kestrel.Http2 - Trace: Connection id "0HMB1REBPPE4G" sending RST_STREAM frame for stream ID 1 with length 4 and flags 0x0.
The server is sending END_STREAM flag, then sending RST_STREAM frame.
.NET SDK (reflecting any global.json):
Version: 6.0.100-rc.1.21417.11
Commit: ca60baef37