Reference · Lesson 1

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 backCaller 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 sendingunknown
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)

faultrequest arrives?work done?response?caller seesnpm run l1 charges
okyesyesyesresult1
drop-requestnono—silence0
drop-responseyesyesnosilence1
slowyesyeslatesilence (for now)1
reject-503refusednoerror5030

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)

policyhowrisk
at-most-oncesend, never retrythe update may not happen
at-least-onceretry until acknowledgedthe update may happen twice
exactly-once effectretry + idempotence or deduplicationneeds 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

termmeaning
remote callAsking another machine to do something by message, then waiting for a reply.
side effectA change the call makes in the world (a charge, an email). Repeating the call repeats it.
partial failureSome parts fail while others work, and no single part sees the whole picture.
unknown outcomeThe caller can't tell whether the side effect happened.
reconciliationLater asking the other side what really happened, to resolve unknown outcomes (Lesson 6).

Sources