fix(io): finalize TCP transport cleanup before actor stop#8206
Draft
Aaronontheweb wants to merge 2 commits into
Draft
fix(io): finalize TCP transport cleanup before actor stop#8206Aaronontheweb wants to merge 2 commits into
Aaronontheweb wants to merge 2 commits into
Conversation
Run async transport finalization during graceful and confirmed closes so TcpConnection no longer falls back to abort cleanup after clean shutdown. Add focused TCP tests covering graceful finalization and unexpected-stop fallback cleanup.
Turn the new shutdown race catches into explicit handled early returns so the transport cleanup path remains idempotent without tripping slopwatch's empty-catch rule.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This is a follow-up to @to11mtm's comment on #8132 about async transport disposal in the TCP actor lifecycle:
#8132 (comment)
This change makes the graceful shutdown path explicit instead of relying on
PostStop()fallback cleanup.ITransportConnectionasynchronously duringTcp.CloseITransportConnectionafter both FINs duringTcp.ConfirmedClosePostStop()abort logic as the fallback for unexpected actor terminationTcpTransportConnectioncleanup idempotent acrossShutdownAsync,CloseAsync,Abort, andDisposeAsyncWhy
TcpTransportConnectionalready exposedDisposeAsync, but the actor lifecycle never actually used it. In practice that meant:PostStop()ConfirmedClosedid not have an explicit async finalization step after the close handshakeThis PR makes the intended lifecycle explicit and keeps the emergency-stop behavior unchanged.
Testing
TcpConnectionBatchingSpeccoverage for:dotnet test src/core/Akka.Tests/Akka.Tests.csproj -c Release --filter \"FullyQualifiedName~TcpConnectionBatchingSpec|FullyQualifiedName~TcpIntegrationSpec\"dotnet build src/core/Akka/Akka.csproj -c Releasedotnet test src/core/Akka.API.Tests/Akka.API.Tests.csproj -c Release