-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Closed
Labels
✔️ Resolution: AnsweredResolved because the question asked by the original author has been answered.Resolved because the question asked by the original author has been answered.Needs: Attention 👋This issue needs the attention of a contributor, typically because the OP has provided an update.This issue needs the attention of a contributor, typically because the OP has provided an update.Status: Resolvedarea-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
When websocket is accepted and processed in background it could happen, that web server uninitialize DefaultHttpContext, causing ObjectDisposedException, when calling websocket.Dispose()
Expected Behavior
calling Dispose does not throw exception
Steps To Reproduce
Simple repro, that works as expected in .net8.0, but throws exception in .net9.0
Exceptions (if any)
ObjectDisposedException at
at Microsoft.AspNetCore.Http.Features.FeatureReferences`1.ThrowContextDisposed()
at Microsoft.AspNetCore.Http.DefaultHttpContext.Abort()
at Microsoft.AspNetCore.WebSockets.AbortStream.Dispose(Boolean disposing)
at System.IO.Stream.Close()
at System.Net.WebSockets.ManagedWebSocket.DisposeCore()
at System.Net.WebSockets.ManagedWebSocket.Dispose()
.NET Version
9.0.101
Anything else?
No response
Metadata
Metadata
Assignees
Labels
✔️ Resolution: AnsweredResolved because the question asked by the original author has been answered.Resolved because the question asked by the original author has been answered.Needs: Attention 👋This issue needs the attention of a contributor, typically because the OP has provided an update.This issue needs the attention of a contributor, typically because the OP has provided an update.Status: Resolvedarea-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions