Unexpected exception in TimingPipeFlusher.TimeFlushAsync when using HttpProtocols.Http1AndHttp2
See original GitHub issueI’m getting a couple dozen “Unexpected exception in TimingPipeFlusher.TimeFlushAsync” exceptions in my logs every day. This happens only when HTTP2 support is enabled in Kestrel.
System.InvalidOperationException: Can't GetResult unless awaiter is completed.
at System.IO.Pipelines.ThrowHelper.ThrowInvalidOperationException_GetResultNotCompleted()
at System.IO.Pipelines.Pipe.GetFlushAsyncResult()
at System.IO.Pipelines.Pipe.DefaultPipeWriter.GetResult(Int16 token)
at System.Threading.Tasks.ValueTask`1.ValueTaskSourceAsTask.<>c.<.cctor>b__4_0(Object state)
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure.TimingPipeFlusher.TimeFlushAsync(MinDataRate minRate, Int64 count, IHttpOutputAborter outputAborter, CancellationToken cancellationToken)
I can’t seem to trigger it myself. The exceptions occur on a production server.
The app is running in Kubernetes from the mcr.microsoft.com/dotnet/core/aspnet:2.2.3-alpine image.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:29 (23 by maintainers)
Top Results From Across the Web
Unexpected exception in TimingPipeFlusher. ...
The exceptions only occur when ListenOptions.Protocols is set to HttpProtocols.Http1AndHttp2, they don't occur when the default HttpProtocols.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
A wrapper would be just be more overhead, state machines, etc…
Honestly we don’t see many people switch between Http.Sys and Kestrel. They usually switch between IIS and Kestrel. If they’re using Http.Sys it’s for a specific feature not available elsewhere.
As expected forcing HttpProtocols.Http2 results in the same exception as HttpProtocols.Http1AndHttp2. Also not related to Alpine, same happens with regular image. I will try to enable verbose logging and see if I can find out more.