Skip to content

HTTP2: HttpClient is still sending DATA after RST #1510

@jkotalik

Description

@jkotalik

I found this while running the Http client stress test. From what I can tell, this is after dotnet/corefx#40180 was merged, which should have fixed this issue.

What I see is that the client is sending a RST frame and then sending a data frame afterward.

       .NET Core: 3.0.0-preview9-19415-13
    ASP.NET Core: 3.0.0-preview9.19416.11
 System.Net.Http: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.0.0-preview9-19415-13\System.Net.Http.dll, last modified 8/16/2019 4:12:38 AM
          Server: Kestrel
      Server URL: http://127.0.0.1:5001/
         Tracing: False
     ASP.NET Log: True
     Concurrency: 12
  Content Length: 1000
   HTTP2 Version: 2.0
        Lifetime: (infinite)
      Operations:  0: GET,  1: GET Partial,  2: GET Headers,  3: GET Parameters,  4: GET Aborted,  5: POST,  6: POST Multipart Data,  7: POST Duplex,  8: POST Duplex Slow,  9: POST Duplex String, 10: POST Duplex Dispose, 11: POST ExpectContinue, 12: HEAD, 13: PUT, 14: PUT Slow, 15: GET Slow
     Random Seed: 515848072
    Cancellation: 0%
Max Content Size: 1000
Query Parameters: 1

Here is the pcap file: https://1drv.ms/u/s!At4nHcZpt7bWwRu60uYm66LT0Yce?e=apU9jY. Look for stream-id 44339, you will see a rst and then a data frame from the client to the server.

On the server, we are seeing errors like:

fail: Microsoft.AspNetCore.Server.Kestrel[13]
      Connection id "0HLPAGU4RFFT0", Request id "0HLPAGU4RFFT0:0000AD3F": An unhandled exception was thrown by the application.
System.IO.IOException: The request stream was aborted.
 ---> Microsoft.AspNetCore.Connections.ConnectionAbortedException: The HTTP/2 connection faulted.
 ---> Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.Http2ConnectionErrorException: HTTP/2 connection error (STREAM_CLOSED): A frame of type DATA was received after stream 44339 was reset or aborted.
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.Http2Connection.ProcessDataFrameAsync(ReadOnlySequence`1& payload) in src\Servers\Kestrel\Core\src\Internal\Http2\Http2Connection.cs:line 476
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.Http2Connection.ProcessFrameAsync[TContext](IHttpApplication`1 application, ReadOnlySequence`1& payload) in src\Servers\Kestrel\Core\src\Internal\Http2\Http2Connection.cs:line 423
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.Http2Connection.ProcessRequestsAsync[TContext](IHttpApplication`1 application) in src\Servers\Kestrel\Core\src\Internal\Http2\Http2Connection.cs:line 222
   --- End of inner exception stack trace ---
   --- End of inner exception stack trace ---
   at System.IO.Pipelines.PipeCompletion.ThrowLatchedException()
   at System.IO.Pipelines.Pipe.GetReadResult(ReadResult& result)
   at System.IO.Pipelines.Pipe.GetReadAsyncResult()
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.Http2MessageBody.ReadAsync(CancellationToken cancellationToken) in src\Servers\Kestrel\Core\src\Internal\Http2\Http2MessageBody.cs:line 102
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpRequestStream.CopyToAsyncInternal(Stream destination, CancellationToken cancellationToken) in src\Servers\Kestrel\Core\src\Internal\Http\HttpRequestStream.cs:line 203
   at HttpStress.StressServer.<>c.<<MapRoutes>b__7_6>d.MoveNext() in C:\Users\jukotali\code\Secondary\corefx\src\System.Net.Http\tests\StressTests\HttpStress\StressServer.cs:line 207
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application) in src\Servers\Kestrel\Core\src\Internal\Http\HttpProtocol.cs:line 618

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions