Open
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
When lots of connections are aborted very quickly, a few of them get stuck in this loop waiting on tasks that never terminate. The remaining (unscheduled) tasks are
Microsoft.AspNetCore.Server.Kestrel.Core.dll!Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.Http2Connection.ProcessRequestsAsync<Microsoft.AspNetCore.Hosting.HostingApplication.Context>(Microsoft.AspNetCore.Hosting.Server.IHttpApplication<Microsoft.AspNetCore.Hosting.HostingApplication.Context> application) Line 409
Microsoft.AspNetCore.Server.Kestrel.Core.dll!Microsoft.AspNetCore.Server.Kestrel.Core.Internal.HttpConnection.ProcessRequestsAsync<Microsoft.AspNetCore.Hosting.HostingApplication.Context>(Microsoft.AspNetCore.Hosting.Server.IHttpApplication<Microsoft.AspNetCore.Hosting.HostingApplication.Context> httpApplication) Line 109
Microsoft.AspNetCore.Server.Kestrel.Core.dll!Microsoft.AspNetCore.Server.Kestrel.Https.Internal.HttpsConnectionMiddleware.OnConnectionAsync(Microsoft.AspNetCore.Connections.ConnectionContext context) Line 227
Microsoft.AspNetCore.Server.Kestrel.Core.dll!Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure.KestrelConnection<Microsoft.AspNetCore.Connections.ConnectionContext>.ExecuteAsync() Line 69
Microsoft.AspNetCore.Server.Kestrel.Core.dll!Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.Http2FrameWriter.WriteToOutputPipe() Line 149
System.Private.CoreLib.dll!System.Threading.Tasks.Task.Run
The second is somewhat irrelevant as it's just waiting for the connection to go away.
The object being awaited is a StreamCloseAwaitable
, which is somehow reused for multiple streams in a single connection in a way I have yet to comprehend.
Expected Behavior
No response
Steps To Reproduce
The repro I'm aware of is a simulated Rapid Reset attack.
Exceptions (if any)
No response
.NET Version
8.0 RC2 and, presumably, main
Anything else?
No response