Page 5 of 8~112 min topic

A/B test lab

Design retries, degradation, and recovery

When reassignment every request → users flicker; metrics uninterpretable, the system must degrade on purpose without widening blast radius.

~14 min this pageFailure handling

1Try it yourself

Decision drill

A/B test lab

Split traffic and measure quality — not every change needs an experiment, but behavior shifts do.

Experiment rigor71%

1/3New system prompt — 50/50 traffic.

2Learn the idea

Read

Classify and bound retries

Map failure classes for POST /v1/support/answer: retryable vs fatal vs needs-human. Retries need budgets, jitter, and idempotency rules aligned to assignment sticky by user_id; analysis gated on sample ratio mismatch (SRM) p>0.001 fail. The chapter’s signature failure — reassignment every request → users flicker; metrics uninterpretable — must take a deliberate branch, not a generic catch-all.

Read

Containment path

Implement the degrade/rollback/refuse behavior experiment owner measuring groundedness lift with SRM checks needs when AB-SRM-FAIL-27 repeats. Prefer scoped controls (one flag, one weight, one tenant, one secret version) over fleet-wide restarts. Preserve evidence; do not delete logs to “clean the demo.”

Read

Implementation artifact

if srm_p <= 0.001:
    freeze_experiment(EXP["key"], reason="srm")

Read

Verify harm reduction

After containment, check groundedness_lift_pp and srm_pvalue moves in the safe direction and watch for retry amplification. Write the stop condition that ends the incident response for this lab.

Read

Stage depth

Chaos note: inject only one fault class at a time and restore fixtures after. Watch for dual failures — dependency down and retry amplifier — which is how reassignment every request → users flicker; metrics uninterpretable becomes an outage. Customer communication templates (even if only for the drill) beat silence. If you queue deferred work, define poison-message handling. Budget documents should state the maximum extra spend allowed during retries. Close the loop by linking the containment action to a dashboard panel for groundedness_lift_pp and srm_pvalue.

Read

Field notes for `ab-test-lab` / `failure-handling`

Draw a state diagram for degrade modes and put it in the repo as ASCII if needed. Cap concurrent retries across the process, not only per request. Ensure cancellation propagates to downstream HTTP clients. When failing closed, choose a user-visible message that does not leak internals. Practice the single command that flips the kill switch or weight to zero. After recovery, drain or inspect deferred work before declaring green. In this chapter the product is support-answer service comparing retriever_v1 vs reranking retriever_v2, the human stakeholder is experiment owner measuring groundedness lift with SRM checks, and the incident id you design against is AB-SRM-FAIL-27. Re-state the oracle in your notes — after 20k sessions, v2 groundedness +2.1pp, p95 latency +80ms within budget — and keep the invariant visible: assignment sticky by user_id; analysis gated on sample ratio mismatch (SRM) p>0.001 fail. Track groundedness_lift_pp and srm_pvalue as the scoreboard. Surface under change control: POST /v1/support/answer. If you only have forty minutes, finish the fixture for reassignment every request → users flicker; metrics uninterpretable before polishing UI. Promotion language stays ternary: promote, hold, or roll back based on evidence, not hope.

Go deeper

Before you start

Why this matters

Assume reassignment every request → users flicker; metrics uninterpretable is happening right now. Write the first safe action, the signal that confirms containment, and the action you will not take (infinite retry, broad restart, deleting evidence). Tie the plan to invariant: assignment sticky by user_id; analysis gated on sample ratio mismatch (SRM) p>0.001 fail.

Check your understanding

Page assessment

Answer from memory. Completion is saved from this evidence, not from opening the next page.

1. Are retry budgets explicit?
2. Is containment scoped?
3. Do you preserve evidence for AB-SRM-FAIL-27?

All responses are required.