Fix stale ACK causing irrecoverable quarantine after transient network disruption#8116
Merged
Aaronontheweb merged 2 commits intoMar 19, 2026
Merged
Conversation
Aaronontheweb
requested changes
Mar 19, 2026
Member
Aaronontheweb
left a comment
There was a problem hiding this comment.
Actually, not sure about something
| { | ||
| var oldBuffer = _resendBuffer; | ||
| _resendBuffer = _resendBuffer.Acknowledge(ack); | ||
| if (ReferenceEquals(_resendBuffer, oldBuffer) && ack.CumulativeAck > _resendBuffer.MaxSeq) |
Contributor
Author
There was a problem hiding this comment.
logging feedback, it can be removed
Arkatufus
added a commit
to Arkatufus/akka.net
that referenced
this pull request
Mar 23, 2026
…k disruption (akkadotnet#8116) * Fix stale remote ack causes disassociation / quarantine * remove redundant code (cherry picked from commit 3b58d43)
This was referenced Mar 24, 2026
This was referenced Mar 31, 2026
This was referenced Apr 8, 2026
Merged
This was referenced May 21, 2026
Open
Closed
Open
Open
This was referenced May 29, 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.
Fixes #6414
Problem
When a transient network disruption occurs and a node reconnects with the same UID (process stayed alive), a stale ACK from the remote node's previous receive buffer state can trigger an
ArgumentExceptioninAckedSendBuffer<T>.Acknowledge(). This exception is wrapped in aHopelessAssociation, which causes an irrecoverable quarantine of the remote node.In production, this quarantine creates an "indirectly connected" topology that can cause SBR's
keep-majoritystrategy to down an entire cluster.The root cause is a guard check that throws when
ack.CumulativeAck > MaxSeq:This happens because:
ReliableDeliverySupervisorcreates a freshAckedSendBufferwithMaxSeq = -1(new endpoint)EndpointReader.PreStart()restores a staleAckedReceiveBufferfrom the shared_receiveBuffersdictionary (UID matches), and sendsACK[0]based on old state0 > -1fires and throws, quarantining the associationFix
Changed the guard in
AckedSendBuffer<T>.Acknowledge()from a hard throw to a no-opreturn this. When the ACK references a sequence number higher than anything in the buffer, there is nothing to acknowledge and nothing to corrupt - the buffer is either empty or contains only messages with lower sequence numbers.Added a warning log at the
ReliableDeliverySupervisorcall site so operators have visibility when stale ACKs are being ignored.Tests
Added two unit tests to
AckedDeliverySpecthat reproduce the exact failure:MaxSeq = -1) receivingACK[0]- the production scenario from Association to [akka_ tcp://name_server:49766] with UId [1896650320] is irrecoverably failed. Quarantining address #6414MaxSeq = 1) receivingACK[5]- stale ACK referencing higher sequence numbersBoth tests fail with the original
ArgumentExceptionon the old code and pass with the fix.