The Two Generals Problem
A classic proof that two parties communicating only over an unreliable channel can never become 100% certain they agree on a plan — every acknowledgment could itself get lost, so perfect coordination via messages alone is provably impossible.
Two generals command armies on opposite hills, both overlooking an enemy camp in the valley. They will only win if they attack at exactly the same time; attacking alone means defeat. Their only way to coordinate is sending messengers through the valley, and any messenger might get captured, so no message is guaranteed to arrive. General A sends "attack at dawn." Even if it arrives, A doesn't know it arrived, so A can't safely attack without confirmation. General B sends back an acknowledgment — but that message can also be lost, so B doesn't know whether A ever received the confirmation, and won't attack without knowing A is going to. A could then send an acknowledgment of the acknowledgment, but that message can be lost too, and the chain never terminates: whatever the last message sent is, its sender can never be sure it arrived.
The clean result is that no finite sequence of messages over an unreliable channel can produce common knowledge that both sides will act — there is always one more acknowledgment that, if lost, breaks the agreement, no matter how many rounds have already succeeded. Real systems don't try to solve this impossibility; they route around it, usually by accepting a small, bounded risk of disagreement (send enough redundant confirmations that the probability of total failure is negligible) rather than insisting on mathematical certainty.
The direct relevance to trading infrastructure is any protocol where an order sent to an exchange might not have its acknowledgment come back: the exchange may have received and executed the order even though your system never saw the fill confirmation, which is exactly why order management systems build in reconciliation and idempotent retries rather than assuming silence means failure.
Two parties coordinating only through messages that can be lost can never achieve perfect certainty they agree, because any last acknowledgment could itself vanish — real systems accept a bounded, small probability of disagreement instead, which is why trading systems reconcile state rather than trusting an unanswered order confirmation to mean "it didn't happen."
Related concepts
Practice in interviews
Further reading
- Gray, Notes on Data Base Operating Systems (1978)