# The Two Generals Problem

> No finite exchange of messages can guarantee agreement when any message or acknowledgement may be lost.

- HTML version: https://robbiepalmer.me/ideas/two-generals-problem
- Source: https://www.cs.yale.edu/homes/aspnes/pinewiki/TwoGenerals.html

The Two Generals Problem asks two separated armies to coordinate an attack using messengers who may
never arrive. One general can send the plan, but cannot know whether the other received it. An
acknowledgement helps the first general and leaves the second unsure whether the acknowledgement
arrived. Every reply creates the need for one more reply.

No finite exchange gives both sides certainty. This does not make retries useless. Retries,
idempotency, and reconciliation can make agreement more likely or make disagreement safe, but they
cannot turn an unreliable channel into a guarantee.

Silence could mean a lost message, a slow peer, or a failed peer. A protocol needs a safe default
when participants cannot establish common knowledge.

## Questions it prompts

* What does each participant know, and what does it merely assume the others know?
* What happens if the final acknowledgement disappears?
* Can disagreement be made safe instead of pretending it cannot occur?

## Related ideas

- [FLP Impossibility](https://robbiepalmer.me/ideas/flp-impossibility.md): A deterministic consensus protocol cannot guarantee both safety and termination in a fully asynchronous system if even one process may crash.

## Where it appears

- Project: [Autonomic Satellite Swarm](https://robbiepalmer.me/projects/autonomic-satellite-swarm.md)

---

Markdown index of this site: https://robbiepalmer.me/llms.txt
