aspnet / KestrelHttpServer

[Archived] A cross platform web server for ASP.NET Core. Project moved to https://github.com/aspnet/AspNetCore
Apache License 2.0
2.63k stars 528 forks source link

Both reader and writer has to be completed to be able to reset the pipe #3006

Closed halter73 closed 5 years ago

halter73 commented 5 years ago

I'm seeing "Both reader and writer has to be completed to be able to reset the pipe" in some HTTP/2 tests where app doesn't fully consume request body. I've noticed this in AppDoesNotReadRequestBody_ResetsAndDrainsRequest and DATA_Received_ButNotConsumedByApp_CountsTowardsInputFlowControl.

[0.003s] [TestLifetime] [Information] Starting test AppDoesNotReadRequestBody_ResetsAndDrainsRequest-CONTINUATION at 2018-10-12T17:51:38
[0.015s] [Microsoft.AspNetCore.Server.Kestrel] [Verbose] Connection id "null" sending SETTINGS frame for stream ID 0 with length 18 and flags NONE
[0.015s] [Microsoft.AspNetCore.Server.Kestrel] [Verbose] Connection id "null" sending WINDOW_UPDATE frame for stream ID 0 with length 4 and flags 0x0
[0.016s] [Microsoft.AspNetCore.Server.Kestrel] [Verbose] Connection id "null" received SETTINGS frame for stream ID 0 with length 0 and flags NONE
[0.053s] [Microsoft.AspNetCore.Server.Kestrel] [Verbose] Connection id "null" sending SETTINGS frame for stream ID 0 with length 0 and flags ACK
[0.054s] [Microsoft.AspNetCore.Server.Kestrel] [Verbose] Connection id "null" received HEADERS frame for stream ID 1 with length 37 and flags END_HEADERS
[0.056s] [Microsoft.AspNetCore.Server.Kestrel] [Verbose] Connection id "null" sending HEADERS frame for stream ID 1 with length 55 and flags END_HEADERS
[0.056s] [Microsoft.AspNetCore.Server.Kestrel] [Verbose] Connection id "null" sending DATA frame for stream ID 1 with length 0 and flags END_STREAM
[0.072s] [Microsoft.AspNetCore.Server.Kestrel] [Warning] Connection processing ended abnormally.
System.InvalidOperationException: Both reader and writer has to be completed to be able to reset the pipe.
   at System.IO.Pipelines.ThrowHelper.ThrowInvalidOperationException_ResetIncompleteReaderWriter()
   at System.IO.Pipelines.Pipe.Reset()
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application) in G:\dev\aspnet\KestrelHttpServer\src\Kestrel.Core\Internal\Http\HttpProtocol.cs:line 635
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequestsAsync[TContext](IHttpApplication`1 application) in G:\dev\aspnet\KestrelHttpServer\src\Kestrel.Core\Internal\Http\HttpProtocol.cs:line 472
[0.073s] [Microsoft.AspNetCore.Server.Kestrel] [Information] Connection id "null", Request id ":00000001": the application completed without reading the entire request body.
[0.073s] [Microsoft.AspNetCore.Server.Kestrel] [Verbose] Connection id "null" sending RST_STREAM frame for stream ID 1 with length 4 and flags 0x0
[0.144s] [Microsoft.AspNetCore.Server.Kestrel] [Verbose] Connection id "null" received DATA frame for stream ID 1 with length 100 and flags NONE
[0.144s] [Microsoft.AspNetCore.Server.Kestrel] [Verbose] Connection id "null" received DATA frame for stream ID 1 with length 100 and flags NONE
[0.144s] [Microsoft.AspNetCore.Server.Kestrel] [Verbose] Connection id "null" received DATA frame for stream ID 1 with length 100 and flags NONE
[0.145s] [Microsoft.AspNetCore.Server.Kestrel] [Verbose] Connection id "null" received DATA frame for stream ID 1 with length 100 and flags NONE
[0.145s] [Microsoft.AspNetCore.Server.Kestrel] [Verbose] Connection id "null" received DATA frame for stream ID 1 with length 100 and flags NONE
[0.145s] [Microsoft.AspNetCore.Server.Kestrel] [Verbose] Connection id "null" received DATA frame for stream ID 1 with length 100 and flags NONE
[0.145s] [Microsoft.AspNetCore.Server.Kestrel] [Verbose] Connection id "null" received DATA frame for stream ID 1 with length 100 and flags NONE
[0.146s] [Microsoft.AspNetCore.Server.Kestrel] [Verbose] Connection id "null" received DATA frame for stream ID 1 with length 100 and flags NONE
[0.146s] [Microsoft.AspNetCore.Server.Kestrel] [Verbose] Connection id "null" received DATA frame for stream ID 1 with length 100 and flags NONE
[0.146s] [Microsoft.AspNetCore.Server.Kestrel] [Verbose] Connection id "null" received DATA frame for stream ID 1 with length 100 and flags NONE
[0.147s] [Microsoft.AspNetCore.Server.Kestrel] [Verbose] Connection id "null" received HEADERS frame for stream ID 1 with length 30 and flags END_STREAM
[0.147s] [Microsoft.AspNetCore.Server.Kestrel] [Verbose] Connection id "null" received CONTINUATION frame for stream ID 1 with length 30 and flags END_HEADERS
[0.147s] [Microsoft.AspNetCore.Server.Kestrel] [Verbose] Connection id "null" sending GOAWAY frame for stream ID 0 with length 8 and flags 0x0
[0.147s] [Microsoft.AspNetCore.Server.Kestrel] [Debug] Connection id "null" is closed. The last processed stream ID was 1.
[0.291s] [TestLifetime] [Information] Finished test AppDoesNotReadRequestBody_ResetsAndDrainsRequest-CONTINUATION in 0.2488673s