New54 new lessons added since Sep 10!
Explore What's New →
Software Development Atlas
Distributed Systems

Partial Failure: Reason About Unknown Outcomes

Reason about distributed operations when one component, message, or observer fails while the rest of the system keeps running.

EvolvingVerified Nov 18, 2026Review target: 180 days

Personal learning atlas by Tran Trong Thuc · About this Atlas · Atlas last updated Nov 29, 2026

Partial Failure: Reason About Unknown Outcomes

TL;DR

Illustrative scenario (hypothetical): A payment terminal times out after a coffee purchase, but the customer receives a debit notification. Neither local observation proves the final outcome of the entire operation. The application should query the authoritative provider state before initiating another payment.

Partial failure occurs when one component completes work while another cannot observe the result. A communication error is not a verdict on a remote commit.

💡 Rule of thumb: In distributed systems, a timeout is a local observation, not a remote verdict. Never assume an unanswered state-changing operation failed without authoritative reconciliation or idempotent protection.

  • Local errors versus distributed ambiguity: An in-process exception propagates according to language/runtime rules; it does not automatically halt the thread. Over a network, a caller may lose a response after the callee commits. Separate the RPC failure from the business outcome.
  • Independent caller and callee observations: The caller and callee form independent local judgments regarding the same RPC; a caller's DEADLINE_EXCEEDED may occur even after the callee has committed. A timeout alone cannot establish whether that happened.
  • Safe retries need a replay contract: Preserve stable business-operation identity for ambiguous writes and use enforced server idempotency, reconciliation or applicable unique constraints/conditional updates. A header containing an idempotency key alone does not make a write safe to repeat.
  • Blast radius and failure isolation: Unbounded waits on slow dependencies can exhaust worker slots, connection pools or memory under load. Choose end-to-end deadlines, propagate cooperative cancellation where supported, and isolate noncritical failures with bounded fail-fast, fallback or graceful-degradation policies.
  • High-risk mistake: Treating a timeout as proof that the operation failed. An unprotected retry of a non-idempotent write after an ambiguous result can duplicate payment, inventory or reservation effects. The actual outcome depends on whether the first attempt committed and on downstream duplicate protection.

The fundamental challenge is not merely failure. It is uncertainty about what already happened.

A timeout is an observation, not a verdict

Suppose a caller waits two seconds and receives no response. Several realities are possible:

  • the request never reached the server;
  • the server received it but has not finished;
  • the server finished and committed, but the response was lost;
  • the response is merely late and arrives after the caller deadline;
  • the server crashed before or after changing durable state.

Therefore a timeout creates an unknown outcome. It does not prove that the remote operation failed.

This is why treating DEADLINE_EXCEEDED as equivalent to “nothing happened” is dangerous for state-changing operations.

Caller and callee can disagree

gRPC documents an important distributed-systems property: client and server make independent local judgments about an RPC. The server can finish successfully while the client reports deadline exceeded because the response arrived too late.

Neither observer is lying. They have different evidence.

Failure has more shapes than “server down”

Design for at least these categories:

  • process crash: one process disappears while peers remain healthy;
  • slow dependency: a service is alive but misses latency budgets;
  • network partition: some nodes or paths cannot communicate while others can;
  • lost request: the caller sent bytes but the callee never received them;
  • lost response: the callee completed work but the caller never learned that;
  • one-way degradation: traffic works in one direction or for one subset of nodes only.

A health check that says “up” cannot distinguish all of these states.

Retrying can repair uncertainty — or duplicate effects

A retry is a new attempt, not a time machine. In particular, a client timeout by itself does not identify whether an earlier write was committed, is still running, or never reached the receiver.

If Charge(payment-42) committed before the response was lost, retrying an unprotected new Charge() may create a second charge if the payment API treats it as a distinct operation.

Use a stable request identity or idempotency key for operations that may be retried after an ambiguous failure. The server must associate retries with the same logical operation, not merely accept a fresh command each time.

Idempotency does not make the network reliable. It makes repeated attempts safer.

Cancellation is not rollback. gRPC Core Concepts says that changes made before cancellation are not rolled back. gRPC Cancellation also requires server handlers to cooperate with cancellation signals. An ambiguous write still needs enforced replay safety or authoritative reconciliation; merely propagating the cancellation signal is insufficient.

Deadlines bound waiting; cancellation bounds wasted work

Every remote dependency consumes time and resources. A caller should propagate a realistic deadline rather than letting each nested service start a fresh full timeout.

When the caller no longer needs a result, propagate cancellation so downstream work can stop where possible. But cancellation is not rollback: changes committed before cancellation can remain committed.

That distinction matters when a user closes a request, an upstream deadline expires, or a fan-out request abandons slow branches.

Partial failure creates blast radius through dependency chains

A small failure can become a system failure when synchronous dependencies wait on one another.

Reason about each dependency by asking:

  • Is it required for correctness, or merely useful?
  • Should we fail-fast, degrade, use a bounded fallback, or isolate it?
  • What deadline and retry budget does it receive?
  • Can one slow dependency exhaust caller threads, connections, or queue capacity?

A noncritical backend is still critical if callers wait forever for it.

Make uncertainty observable

HTTP status alone is not enough to reconstruct a partial failure. Carry a correlation ID or request ID across service boundaries and preserve it in logs and traces.

Useful signals include dependency latency, timeout rate, retry attempts, duplicate-suppression hits, cancellation count, saturation, and success/error rates by dependency.

For ambiguous writes, record the stable operation ID alongside authoritative business state so an operator can answer: did this logical operation commit?

Illustrative scenario (hypothetical)

A checkout service calls a payment provider with POST /charges. The provider commits the charge, but the response packet is lost. Checkout reaches its timeout and automatically retries with a fresh request ID.

Impact: without provider-side idempotency or reconciliation, the customer may be charged twice even though the application saw one checkout action. One timeout and one later success can be consistent observations of separate attempts. This is an invented teaching scenario, not a measured payment incident.

Root cause: the caller interpreted timeout as proof of failure and retried a non-idempotent side effect without a stable logical request identity. Caller and callee had different local observations of the first attempt.

Correct pattern: assign a stable payment operation ID before the first attempt. Reuse the same key if the provider enforces a documented idempotency contract, or reconcile authoritative provider state before reissuing a write. Keep an end-to-end deadline and bounded retry policy, propagate cooperative cancellation where useful, persist ambiguous-operation evidence, and correlate all transport attempts without generating new logical payment identities.

Self-check: a payment call timed out. Is it safe to assume no charge happened?

No. The request may have committed and only the response may be missing. Treat the outcome as unknown until you can query/reconcile authoritative state or safely retry using stable request identity and idempotent semantics.

Production checklist

  • Remote timeouts are modeled as potentially ambiguous outcomes.
  • State-changing retries reuse a stable request identity or idempotency key.
  • Retry budgets are bounded and placed intentionally in the dependency chain.
  • End-to-end deadlines are propagated instead of reset at every hop.
  • Cancellation stops unnecessary downstream work where supported.
  • Code does not assume cancellation rolls back already committed changes.
  • Critical and noncritical dependencies have explicit fail-fast/degrade/fallback/isolation behavior.
  • Connection, worker, thread, and queue saturation are considered in blast-radius analysis.
  • Correlation IDs connect caller, callee, retry, and business-state evidence.
  • Dependency metrics expose latency, timeout, retry, cancellation, and error behavior.
  • Ambiguous writes have a reconciliation path.
  • Failure tests include slow, blackholed, partitioned, and lost-response cases, not only clean 500 errors.

Agent rule

When a remote call fails, do not collapse “I did not receive a successful response” into “the operation did not happen.” Model the possible remote states, preserve logical request identity across retries, bound waiting and retry amplification, and design an evidence path that can reconcile ambiguous outcomes.

Sources

Primary source claims rechecked on 2026-11-18:

On this page