Partial failure
What a caller can know after a remote call. One page, for quick lookup.
The rule
A remote call is two messages: a request and a response. Silence carries no information. A timeout means you stopped waiting, not that nothing happened.
Three outcomes
| What came back | Caller knows |
|---|---|
| success response (even a late one) | done |
a refusal the server promises is made before any work (503 by contract, 4xx validation) | not done |
| nothing, a timeout, or a connection broken after sending | unknown |
| a connect timeout (the request was never sent) | not done |
"Not done" depends on the API's contract. The lab's PayCo refuses with 503 before working. Stripe says to treat a 500 "as indeterminate", so for Stripe every 5xx is unknown.
The fault table (labs/payflow/lib/net.ts)
| fault | request arrives? | work done? | response? | caller sees | npm run l1 charges |
|---|---|---|---|---|---|
ok | yes | yes | yes | result | 1 |
drop-request | no | no | — | silence | 0 |
drop-response | yes | yes | no | silence | 1 |
slow | yes | yes | late | silence (for now) | 1 |
reject-503 | refused | no | error | 503 | 0 |
Two rules make it realistic: a lost message is silence, not an error; and giving up (aborting) only stops the caller waiting. A request already on the wire is still delivered and still processed.
Simple delivery policies (Kleppmann, Slide 90)
| policy | how | risk |
|---|---|---|
| at-most-once | send, never retry | the update may not happen |
| at-least-once | retry until acknowledged | the update may happen twice |
| exactly-once effect | retry + idempotence or deduplication | needs Lessons 3–5 |
Lab, seed 1, naive at-least-once on 200 charges with 5% of each fault: 22 orders charged twice. Other seeds also show charged, but shop says failed (seed 42: 1).
Vocabulary
| term | meaning |
|---|---|
| remote call | Asking another machine to do something by message, then waiting for a reply. |
| side effect | A change the call makes in the world (a charge, an email). Repeating the call repeats it. |
| partial failure | Some parts fail while others work, and no single part sees the whole picture. |
| unknown outcome | The caller can't tell whether the side effect happened. |
| reconciliation | Later asking the other side what really happened, to resolve unknown outcomes (Lesson 6). |