Killing a Relay at Full Load: Qualifying Agent Channels for Recovery, Not Just Survival

A peer-to-peer agent mesh rarely breaks at the moment a node dies. The real damage starts right after, when every orphaned peer re-handshakes at once and the surviving nodes spend their capacity on cryptography instead of traffic. In a unit test or a low-load soak this never shows up, because one reconnect costs almost nothing. The qualification test has to reproduce the crowd of reconnects, not the single fault.

Why the fault is not the failure

When a relay or coordinating peer drops, every session through it breaks together. Each affected agent then repeats the expensive path: capability discovery, mutual authentication with DID attestation, resolving and checking the counterpart's DID document, and only then resending the backlog in its retry queue. Binary serialization keeps steady-state frames small, but replayed messages are re-encrypted with fresh nonces and leave one at a time instead of in batches, so the survivors take handshake load, replayed load and normal load all at once. A full attested handshake with document resolution probably costs around an order of magnitude more CPU than resuming a session (an estimate, and it varies a lot with the signature suite). Once handshakes overrun their deadlines, clients time out and try again, every retry is another handshake, and the mesh settles into a metastable state that keeps itself going after the original fault has been repaired.

The test that reproduces it

Run the mesh at production message rate with a realistic payload mix, and run it long enough for session caches and connection pools to warm up, because a cold system reconnects in a way the field never will. Then kill one relay hard, by dropping its packets rather than closing sockets cleanly, so peers only find out through missed heartbeats. With a heartbeat interval of 500 ms, a few missed beats line up most peers' failure detection inside the same short window, and that synchronized wave is the stimulus you want. Bring the relay back after a hold period and measure goodput: completed, verified, deduplicated application messages per second, counted per channel through sequence identifiers. Do not use connection counts or CPU as the metric. Repeat the kill at several load fractions, since this failure has a threshold, and a pass at moderate load says nothing about the point where the system tips over.

Where to set the bar

Fail qualification if goodput does not return to its pre-fault baseline within a bounded number of heartbeat intervals after the relay is restored, because a system that stays degraded once its trigger is gone is metastable, and extra capacity in the field will not fix it reliably.

What the fix costs

The usual remedies all work, and each one costs something. Jittered exponential backoff breaks up the reconnect wave but makes recovery slower for every peer, including the ones that could have come back at once. Session resumption tickets avoid the full attested handshake, but they keep key material valid for longer, and that conflicts with the freshness that identity and transport security standards such as W3C DIDs and mutual TLS are meant to guarantee. A cap on concurrent handshakes, with admission priority for known peers, protects the survivors but can block a new agent that a recovering task needs. So the test lead has to decide which of these trade-offs the plan accepts, then rerun the kill at the exact load fraction where the first run tipped over, since the remedy only counts once it is proven at that point.

Why not qualify recovery with a graceful shutdown of the relay?

With a graceful close, peers get an explicit signal, can drain their queues and reconnect in an orderly way, so the synchronized wave never forms. Hard packet loss makes every peer detect the failure through heartbeat timeouts, which lines up their reconnects, and that alignment is what pushes the mesh into the metastable state the plan has to rule out.

Back to A2ACommunication · Domains

← Back to A2ACommunication
Engineering & Architecture Brief

Killing a Relay at Full Load: Qualifying Agent Channels for Recovery, Not Just Survival

A peer-to-peer agent mesh rarely breaks at the moment a node dies. The real damage starts right after, when every orphaned peer re-handshakes at once and the surviving nodes spend their capacity on cryptography instead of traffic. In a unit test or a low-load soak this never shows up, because one reconnect costs almost nothing. The qualification test has to reproduce the crowd of reconnects, not the single fault.

Why the fault is not the failure

When a relay or coordinating peer drops, every session through it breaks together. Each affected agent then repeats the expensive path: capability discovery, mutual authentication with DID attestation, resolving and checking the counterpart's DID document, and only then resending the backlog in its retry queue. Binary serialization keeps steady-state frames small, but replayed messages are re-encrypted with fresh nonces and leave one at a time instead of in batches, so the survivors take handshake load, replayed load and normal load all at once. A full attested handshake with document resolution probably costs around an order of magnitude more CPU than resuming a session (an estimate, and it varies a lot with the signature suite). Once handshakes overrun their deadlines, clients time out and try again, every retry is another handshake, and the mesh settles into a metastable state that keeps itself going after the original fault has been repaired.

The test that reproduces it

Run the mesh at production message rate with a realistic payload mix, and run it long enough for session caches and connection pools to warm up, because a cold system reconnects in a way the field never will. Then kill one relay hard, by dropping its packets rather than closing sockets cleanly, so peers only find out through missed heartbeats. With a heartbeat interval of 500 ms, a few missed beats line up most peers' failure detection inside the same short window, and that synchronized wave is the stimulus you want. Bring the relay back after a hold period and measure goodput: completed, verified, deduplicated application messages per second, counted per channel through sequence identifiers. Do not use connection counts or CPU as the metric. Repeat the kill at several load fractions, since this failure has a threshold, and a pass at moderate load says nothing about the point where the system tips over.

Where to set the bar

Fail qualification if goodput does not return to its pre-fault baseline within a bounded number of heartbeat intervals after the relay is restored, because a system that stays degraded once its trigger is gone is metastable, and extra capacity in the field will not fix it reliably.

What the fix costs

The usual remedies all work, and each one costs something. Jittered exponential backoff breaks up the reconnect wave but makes recovery slower for every peer, including the ones that could have come back at once. Session resumption tickets avoid the full attested handshake, but they keep key material valid for longer, and that conflicts with the freshness that identity and transport security standards such as W3C DIDs and mutual TLS are meant to guarantee. A cap on concurrent handshakes, with admission priority for known peers, protects the survivors but can block a new agent that a recovering task needs. So the test lead has to decide which of these trade-offs the plan accepts, then rerun the kill at the exact load fraction where the first run tipped over, since the remedy only counts once it is proven at that point.

Technical FAQ: Why not qualify recovery with a graceful shutdown of the relay?

With a graceful close, peers get an explicit signal, can drain their queues and reconnect in an orderly way, so the synchronized wave never forms. Hard packet loss makes every peer detect the failure through heartbeat timeouts, which lines up their reconnects, and that alignment is what pushes the mesh into the metastable state the plan has to rule out.

Related Architecture Specifications (A2A): a2atinfra.com · a2atswarm.com · a2atops.com

More Technical Articles on a2acommunication.com

Bandwidth Reduction and Throughput Multipliers via Binary Agent Serialization →Noise_XX Handshake Performance and Session Resumption in Ephemeral Swarms →