Backport #8421 to v1.5: flush graceful Disassociate PDUs before transport force-close on shutdown - #8487
Merged
Merged
Conversation
…port force-close on shutdown ActorTransportAdapter.Shutdown() started manager.GracefulStop() and WrappedTransport.Shutdown() concurrently. The manager's child association actors (the ProtocolStateActors under AkkaProtocolTransport) write the graceful Disassociate PDU as part of their own shutdown, so running the wrapped-transport teardown concurrently let the underlying transport force-close the channel before that PDU reached the wire. Peers were then left with a zombie association until the transport failure detector tripped (acceptable-heartbeat-pause, 120s by default); under the trttl/gremlin test adapters, which swallow the raw TCP close, that lost PDU is the sole prompt teardown signal. Sequence the two operations: stop the manager first (bounded by flush-wait-on- shutdown), then tear down the wrapped transport. The wrapped transport is torn down whether or not the manager stopped cleanly, so shutdown cannot hang on this ordering. (cherry picked from commit a918393)
This was referenced Aug 27, 2026
Closed
Closed
This was referenced Aug 30, 2026
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.
Clean cherry-pick of #8421 (dev squash a918393) onto v1.5, whose copy of
ActorTransportAdapter.Shutdown()was byte-identical to the pre-fix dev version.Shutdown()previously stopped the adapter manager and tore down the wrapped transport concurrently, so the transport could force-close the channel before the child association actors' graceful Disassociate PDU reached the wire. Peers then held a zombie association until the transport failure detector tripped - up toacceptable-heartbeat-pause, 120s by default - on every graceful shutdown or rolling restart. The fix sequences the teardown: manager (and its Disassociate-writing children) first, wrapped transport after, each still bounded byflush-wait-on-shutdown. The wrapped transport is torn down even if the manager stop faults, and the returned task's never-throw semantics are unchanged.v1.5 relevance: v1.5 is classic-remoting only, so this is the production shutdown path for every v1.5 cluster. On dev the fix was validated by two consecutive fully-green multi-node CI runs, including a complete clean run of the non-blocking artery lanes.
Validated on the v1.5 toolchain:
Akka.Remotebuilds clean for netstandard2.0 and net6.0 at 0 warnings; transport-adapter suite 14/14 and the broader Transport filter 105/105 on net10.0. Single file touched; release-notes roll-up left to the next versioned release PR per convention.