advanced24 min studyLesson 238 in Engineering

Treat timeouts as suspicions under a failure model

Distinguish delayed evidence from crash proof, relate completeness and accuracy, and calculate a narrowly specified false-suspicion model.

On this page

What you’ll understand

  • Explain why an asynchronous timeout cannot prove a remote process crashed.
  • Distinguish detector completeness from accuracy and protocol safety.
  • Analyze a simplified miss model without assuming independent production delays.

A monitor stops hearing from a worker. The worker may have crashed, the network may be delayed, its process may be paused, or the monitor may itself be starved. Waiting forever prevents recovery; declaring certainty too early can create competing owners. A failure detector provides suspicions that a protocol interprets under stated assumptions. Good engineering separates how quickly suspicion arrives from what actions remain safe even when that suspicion is wrong.

A missing response has several indistinguishable causes

In a fully asynchronous model with no known upper bound on message delay or scheduling delay, a finite period of silence cannot distinguish a crashed participant from a correct but very slow one. A timeout is therefore a policy for suspecting, not a measurement that proves the remote process has stopped executing. The same silence can be observed during network partition, packet loss, scheduler stalls, long garbage collection, or overload. Local elapsed time must itself use an appropriate clock, but an ideal local timer still cannot reveal which remote cause produced the missing evidence.

Failure-detector theory separates completeness, concerning eventual suspicion of crashed participants, from accuracy, concerning mistakes about correct participants. Different classes make different eventual or perpetual promises. These properties are assumptions about the detector's outputs, not automatically delivered by choosing a timeout value. A deployment may assume that timing eventually becomes favorable enough for a protocol to make progress while still preserving safety during earlier mistakes. Keep that liveness argument separate from the resource and replication rules that prevent conflicting effects. An unsafe takeover does not become safe merely because the timeout was chosen from a plausible percentile.

tnow−tlast observed>Δ⟹suspect⁡t_{\mathrm{now}}-t_{\mathrm{last\ observed}}>\Delta\quad\Longrightarrow\quad\operatorname{suspect}
All readings use the same suitable local elapsed clock and Delta is a configured duration. This operational rule produces suspicion; without stronger timing assumptions it is not an implication that the remote participant crashed.↔ Scroll wide equations horizontally.

Tune a detector against an explicit workload

Shorter thresholds can improve response to genuine failures while increasing false suspicions under ordinary delay. Longer thresholds can reduce churn but leave failed work assigned for longer. Heartbeat cadence, network paths, observer CPU pressure, and retry policy all affect the tradeoff. Measure the distribution of inter-arrival gaps for the relevant workload, including correlated pauses, rather than substituting a service's unrelated request latency percentile. A detector can be adaptive, but adaptation does not erase its model assumptions. Document what a suspect event triggers: investigation, reduced traffic, a re-election attempt, or a resource authority change.

For a narrowly specified calculation, suppose a healthy participant independently misses each heartbeat opportunity with probability p. Requiring r misses in a particular fixed group gives probability p raised to r for that group's all-missed outcome. Real gaps often correlate, so applying this formula to production without testing independence can dramatically understate false suspicions. Overlapping sliding windows also do not behave like independent groups. Specify whether the counted outcome is a candidate window, an episode of suspicion, or a transition that actually triggers recovery; those counts can differ even over the same heartbeat trace.

Pr⁡(all missed in one fixed group)=pr,E[Ngroups all missed]=Gpr\Pr(\text{all missed in one fixed group})=p^r,\qquad\mathbb E[N_{\mathrm{groups\ all\ missed}}]=G p^r
The first expression assumes r independent miss indicators with common probability p for a known healthy participant. The expectation counts G specified groups; it is not a guarantee of Gp^r distinct recovery actions.↔ Scroll wide equations horizontally.

Safety must survive a mistaken suspicion

A protocol can use suspicion to try a new leader or redirect work while requiring separate authoritative evidence before accepting protected effects. Leases, fencing, durable generations, and quorum protocols address different pieces of that design; none follows automatically from the detector's confidence score. Recovery can also amplify the original overload by creating retries, cache misses, or concurrent replacement work. Rate-limit or stage actions according to the operational contract and examine whether the detector becomes unstable under the very load produced by its reactions. Test false suspicion as an expected failure mode rather than only testing a clean process crash.

The two-state Markov lab illustrates one abstract suspicion process while the monitored participant remains healthy. State 0 means not suspected and state 1 suspected. Reset, set both transition p=0.2 and recovery q=0.4, predict the state 1 probability after three transitions, then Step three times. The exact probabilities approach a stationary suspected fraction of one third under this model; the third-step value is 0.312. These are finite-step distributions, not sampled heartbeat traces or actual failures. A fresh parameter comparison begins with Reset and re-setting both controls, because editing alone retains the elapsed transition index.

Count false candidate groups under independence

A healthy participant has independent heartbeat-miss probability 0.1 for this fictional calculation. A detector examines 1000 specified disjoint groups of three opportunities and marks a group as a candidate when all three are missed. Compute the expected number of marked groups.

  1. For one specified group, the all-missed probability is 0.1³=0.001, or 0.1%. The participant is assumed healthy throughout.

  2. The expected count over 1000 groups is 1000×0.001=1 marked group. This is an expectation over the model, not a prediction that every run contains exactly one.

  3. A real detector may merge candidates into one episode or use overlapping windows. Correlated pauses invalidate the independent-miss probability, so this result cannot by itself establish an operational false-takeover rate.

The result

The model expects one all-missed group per 1000 such groups. It neither proves a crash when a group is marked nor counts actual safe authority changes.

Explore the model

Interactive lab

Interactive lab · markov

Separate suspicion transitions from actual crashes

Reset, set both transition p=0.2 and q=0.4, predict state 1 probability after three transitions, then Step three times. Initial state distribution is(1, 0); the third-step suspected probability is 0.312. State labels are an illustrative detector interpretation, not observed network failures or random trajectories.

Separate suspicion transitions from actual crashesExact finite-step probabilities for a two-state chain starting in state 0, not sampled trajectories. Playback advances two transitions per second. When p = q = 0 every distribution is stationary; when p = q = 1 the chain alternates forever. A single zero transition creates an absorbing state. Current readings: P(state 1) at step 0: 0%; Stationary P(state 1): 60%; Chain behavior: Monotone convergence. All parameters are adjustable with the labeled controls below.Two-state Markov distribution after 0 steps: state zero probability 1, state one probability 0.Initial distribution (1, 0) · step 0p = 0.3q = 0.201100%0%1−p1−qP(0)P(1)Monotone convergence
P(state 0)P(state 1)Stationary distribution
P(state 1) at step 0
0%
Stationary P(state 1)
60%
Chain behavior
Monotone convergence
t = 0 s

Exact finite-step probabilities for a two-state chain starting in state 0, not sampled trajectories. Playback advances two transitions per second. When p = q = 0 every distribution is stationary; when p = q = 1 the chain alternates forever. A single zero transition creates an absorbing state. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.

Look forThis exact two-state chain models false-suspicion episodes of a healthy participant. Its stationary state 1 fraction is p/(p+q)=1/3 here; real detector timing and dependence need separate evidence.

Check your understanding

A remote worker has not answered within a local timeout in a model with unbounded network and scheduling delays. What is justified?

Try it yourself

Under independent misses with p=0.2, compare an all-missed group of two opportunities with one of three. What does adding the third opportunity fail to prove?

Take a moment to make a prediction or work it out on paper. Open a hint when you need one.

Give me a hint

Compute 0.2² and 0.2³, then separate probability reduction from certainty about a remote crash.

Compare with the solution

The probabilities are 0.04 and 0.008, or 4% and 0.8% for their respective specified groups. Requiring another miss lowers this modeled false-candidate probability but does not make suspicion proof of a crash; it can also delay genuine-failure detection.

Take it with you

  • A timeout is an operational suspicion, not an asynchronous crash proof.
  • Completeness, accuracy, and the safety of recovery actions are different properties.
  • False-suspicion calculations require a stated observation unit and dependence model.

Read further

Original sources and deeper explanations to follow at your own pace.

Optional progress, saved in this browser when available. Revisit any lesson at any time.

Lesson not marked complete.