Repository navigation
Handle DefaultConnectionContext abort/dispose cancellation race - #68146
scarab-systems wants to merge 2 commits into
Conversation
|
Thanks for your PR, @scarab-systems. Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
|
@dotnet-policy-service agree |
PureWeen
left a comment
There was a problem hiding this comment.
The current head fixes the documented Abort/Dispose process crash with a narrowly scoped race tolerance. The process-level regression has a causal failing control, and the focused reconciliation found no supported post-disposal notification contract or production consumer path that would make the uncanceled token state a regression.
Prepared with GitHub Copilot and reviewed by a human.
|
Looks like this PR hasn't been active for some time and the codebase could have been changed in the meantime. |
Summary of the changes (Less than 80 chars)
Handle DefaultConnectionContext abort/dispose cancellation race
Description
DefaultConnectionContext.Abort()queues cancellation of the connection-closed token on the ThreadPool. If the connection is disposed before that queued work runs, the queuedCancel()can observe a disposedCancellationTokenSourceand raiseObjectDisposedExceptionon the background worker.This change makes the queued cancellation tolerate that already-disposed state. It also adds a
RemoteExecutorregression test that forces the queued cancellation to run afterDisposeAsync().Validation:
./restore.sh --no-build-nodejs --no-build-java --no-build-nativesource ./activate.sh >/dev/null && dotnet test src/Servers/Kestrel/Core/test/Microsoft.AspNetCore.Server.Kestrel.Core.Tests.csproj --no-restore --filter DefaultConnectionContextDisposeAsyncAfterAbortDoesNotCrashProcesssource ./activate.sh >/dev/null && dotnet test src/Servers/Kestrel/Core/test/Microsoft.AspNetCore.Server.Kestrel.Core.Tests.csproj --no-restoreFixes #57098