Two Generals’ Problem and Idempotency | by Ali Gelenler | Medium
Introduction
The Two Generals’ Problem is a thought experiment in computer science and distributed systems that highlights the challenge of achieving reliable communication over an unreliable network. The problem remains unsolved and it illustrates the inherent difficulty in coordinating actions between two parties (generals, in this case) when messages can be lost or interrupted.
Imagine two generals, each leading their own army, must coordinate a joint attack on a city. They are stationed far apart and can only communicate by sending messengers across enemy territory. However, these messengers can be captured, meaning their messages might not reach the other side.
Suppose General 1 sends a message to General 2 proposing a time for the attack. But General 1 can’t be sure the message was delivered unless they receive a confirmation.
So, General 2 sends back an acknowledgment. But now General 2 doesn’t know if that acknowledgment reached General 1. To be safe, General 1 would need to confirm receipt of the acknowledgment… and so on.
This creates an infinite loop of uncertainty. No matter how many confirmation messages are exchanged, neither general can be completely certain that the other is ready to attack at the same time.
This is known as the Two Generals Problem, and it proves that reliable agreement is impossible when communication can fail—even between honest parties.

Comparison: The Two Generals problem vs Byzantine Generals
Feature Two Generals Problem Byzantine Generals Problem Goal Two generals agree on whether to attack. Multiple generals reach agreement on a plan (attack/retreat). Type of Fault Unreliable communication (messages may be lost). Faulty/malicious nodes (traitors can lie or behave arbitrarily). Trust Assumption Both generals are honest. Some generals may be malicious or traitorous. Main Challenge Can’t be sure a message was received (infinite acknowledgment loop). Some nodes may lie and send conflicting messages to others. Communication Channel Faulty (messages may be lost). Reliable, but nodes may be faulty (Byzantine behavior). Problem Type Agreement is impossible due to network unreliability. Agreement is hard due to untrusted participants. Solvability Impossible with just 2 nodes over unreliable channels. Solvable with ≥ 3f + 1 nodes to tolerate f faulty nodes. Real-World Analogy Email lost in spam folder—did they read it? Group chat where one person lies to different members. Typical Solution No perfect solution. Approximated using retries, timeouts. Solved using Byzantine Fault Tolerant algorithms (e.g., PBFT, Tendermint). Summary
- Two Generals Problem = Problem with message delivery reliability
- Byzantine Generals Problem = Problem with trustworthiness of nodes.
Both problems inspired modern distributed consensus systems — but Byzantine fault tolerance is more general and harder to solve.
Link to originalDistributed Systems 2.2: The Byzantine generals problem