Skip to content

Backport #8421 to v1.5: flush graceful Disassociate PDUs before transport force-close on shutdown - #8487

Merged
Aaronontheweb merged 3 commits into
v1.5from
backport/8421-to-v1.5
Aug 26, 2026
Merged

Backport #8421 to v1.5: flush graceful Disassociate PDUs before transport force-close on shutdown#8487
Aaronontheweb merged 3 commits into
v1.5from
backport/8421-to-v1.5

Conversation

@Aaronontheweb

Copy link
Copy Markdown
Member

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 to acceptable-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 by flush-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.Remote builds 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.

…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)
@Aaronontheweb Aaronontheweb added akka-remote akka.net v1.5 Issues affecting Akka.NET v1.5 labels Aug 26, 2026
@Aaronontheweb Aaronontheweb added this to the 1.5.71 milestone Aug 26, 2026
@Aaronontheweb
Aaronontheweb merged commit 04f10cb into v1.5 Aug 26, 2026
8 of 12 checks passed
@Aaronontheweb
Aaronontheweb deleted the backport/8421-to-v1.5 branch August 26, 2026 14:01
This was referenced Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

akka.net v1.5 Issues affecting Akka.NET v1.5 akka-remote

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant