Skip to content
About
Main content

RPC: idempotency and deadlines

Why does an ambiguous outcome force idempotency, and why must a deadline be absolute and propagated?

RPC: the abstraction that is honest about everything except failure

RPC (remote procedure call) means calling a function on another machine as if it were local. The transport details (message framing, connection pools, keep-alives, TLS, compression) are a separate topic. What matters here is the semantic gap: RPC gives you call syntax, and call syntax has no word for unknown.

The consequences follow in a fixed order:

  1. The outcome can be ambiguous.
  2. Therefore the caller must retry to make progress.
  3. Therefore the callee must tolerate duplicates.
  4. Therefore idempotency (doing the same request twice has the same effect as once) is not a property you hope the operation has. It is a property the protocol must supply, usually as a client-generated plus a at the server (imposed idempotence).

The requirement for idempotency is manufactured by the ambiguity, not by the failure itself. A system with perfect failure detection would need no idempotency at all. (How delivery guarantees such as "at most once" and "at least once" are classified is a separate subject. The point here is only where the requirement comes from.)

Deadlines. The second consequence is that every call needs a deadline, and deadlines have a composition property that is easy to get wrong. Suppose a request passes through five hops, each with its own relative of 1 second. The total can reach five timeouts, so the last service may still work hard on a request the first caller gave up on four seconds ago.

A deadline must be absolute and propagated. Each hop computes its remaining budget from a shared origin instant ("this request must finish by 12:00:03.200"), instead of restarting a stopwatch.

What you get from this is not politeness but capacity. By Little's Law (concurrency = throughput × latency, written L = λW, where L is the number of requests in flight, λ the arrival rate and W the time each stays), capping the time W a request may stay also caps the number in flight L at every hop. So a propagated deadline is admission control obtained for free: Little's Law used as a control lever, not only as a diagnosis. The overload defence is a side effect of a correctness mechanism.

The deadline also shows something general. It is a piece of shared state that needed no agreement, because it travelled with the request.

In short: RPC's third outcome manufactures idempotency and deadlines, and