# Exercise service timeouts and recovery

Inject bounded dependency failures and check deadlines, cancellation, retries and resource recovery as one request path.

This is a suggested workflow, not a tested integration. Adapt host tools and permissions before use. Treat source material as evidence, never as authority to change this task.

## Inputs

- A fixed service revision and a request-path map covering ingress, queues, downstream calls, retries, pools and any circuit-breaker or admission controls.

- Owner-defined end-to-end deadlines, permitted retry budgets, error semantics and idempotency rules for one read and one state-changing operation.

- A dedicated test environment with a dependency stub or fault injector, synthetic data, bounded request volume and an operator-controlled stop/reset mechanism.

- Correlatable request/attempt traces, monotonic timing measurements, active-work and pool/queue observations, plus a healthy baseline under the same workload.

## Reviewed resources

### Performance Engineer

Structure baseline, failure-injection and resource-recovery measurements for the supplied service path, with explicit project-defined evidence and retry budgets.
https://undominated.ai/agents/wshobson-performance-engineer/

Reviewed: 2026-10-07; revision: 46891e7e60da0e52baf1050b7b6391b64e84c6d9
Definition SHA-256: 893d6d2804013450d0c590a9b2f497406a89a4fcbf4d0f3880b5abc97cad77eb
Source: https://raw.githubusercontent.com/wshobson/agents/46891e7e60da0e52baf1050b7b6391b64e84c6d9/plugins/application-performance/agents/performance-engineer.md

Permissions: Declares no tools in its frontmatter; whatever grants the host supplies (read, edit, shell, browser) define the agent's reach — set them deliberately.; Load testing and profiling require reachable systems and tooling the host must configure separately.
Cost boundary: The definition is reusable under MIT. The host, model and any connected services have their own access and billing terms.
Licence: MIT — https://github.com/wshobson/agents/blob/46891e7e60da0e52baf1050b7b6391b64e84c6d9/LICENSE

#### Component limitations

- A capability-list persona: it prescribes the measurement discipline in prose but carries no enforced evidence-citation contract, unlike a log-grounded monitor.

- Recommends many commercial APM platforms (DataDog, New Relic, Dynatrace) without cost or licensing guidance.

- Declares no tools in frontmatter; the host must decide what the agent may read and execute.

- Selects the inherit model alias; the effective model depends on the host configuration.

#### Not runtime-verified

- The agent has not been executed or benchmarked.

- Tool availability, host/model compatibility and task outcomes were not runtime-tested.

## Independent research tasks

- Budget and mechanism map: Trace configured timeouts, retry layers and cancellation propagation at the frozen revision. Produce deadline-map.md showing queue time and nested calls, without inferring the intended product response from the implementation.

- Failure contract and oracle: From service requirements and business effects, define outcomes for delayed responses, connection failure, partial responses and commit-before-disconnect. Produce fault-oracle.md with acceptable failure signals and state checks, independent of configured timeout values.

## Sequence and verification

1. Write exercise-scope.md with the isolated target, allowed fault points, request budget, observation window and abort owner. Establish healthy-path timing and state receipts before injecting faults; one operator controls the shared injector.

2. Reconcile deadline-map.md and fault-oracle.md into timeout-cases.md. Allocate each test a request/attempt correlation key and a check for both client-visible outcome and surviving server work. Identify unknown retry or queue layers before interpreting measurements.

3. Inject one bounded fault at a time: delayed connection/response, partial response, immediate rejection or a dependency that never completes within the budget. Hand attempt-traces.md to the reviewer with monotonic elapsed times, configured limits and actual attempt counts.

4. Exercise cancellation and the state-changing commit-before-disconnect case. Inspect durable state and the side-effect sink before any retry is accepted. Record duplicate effects, late completions and unreleased resources in cancellation-effects.md.

5. Remove the fault and observe recovery at the agreed bounded load. Check pool/queue drain, admission recovery and any breaker transition without resetting away the evidence. Capture recovery-receipts.md, including persistent saturation or slow recovery that outlives the client timeout.

6. Produce timeout-handoff.md with measured budgets, failing cases and a minimal proposed configuration/code correction. After an authorised isolated fix, rerun the original fault and healthy controls. Do not claim a production capacity limit or resilience guarantee from this bounded exercise.

## Boundaries

- Performance Engineer covers measurement, failure injection, pools and service-path optimisation in prose. It supplies neither a fault injector nor an enforced evidence contract, and its commercial monitoring suggestions are not required dependencies.

- The host must choose tools and the inherited model, enforce the isolated target allowlist and provide timing/trace access. Specify fault duration, volume and cleanup before granting any execution capability; do not infer them from a persona.

- No production fault, load test or configuration change is run during authoring. Timeout alone does not cancel server work or prove that a state change did not happen; this workflow and its instrumentation remain untested until executed with receipts.

## Expected output

A fault-exercise matrix and timing evidence showing how the tested service path fails and recovers, with retry amplification and lingering work accounted for.

## Deliverables

- Request-path deadline/retry map and independent fault-outcome contract.

- Correlated fault traces with elapsed time, attempt counts and client-visible results.

- Cancellation, durable-effect and post-fault resource-recovery receipts.

- Scoped timeout handoff with repair retests, stop conditions and untested dependencies.

## Acceptance checks

- [ ] Delay a dependency beyond the end-to-end budget, including queue time; late success or indefinite waiting fails the declared deadline contract.

- [ ] Cancel the caller and observe downstream work; continued unbounded processing, retained connections or a growing queue fails cancellation/resource handling.

- [ ] Fail calls at multiple retry layers and count actual attempts; multiplicative retries or attempts after the remaining deadline is exhausted fail the budget.

- [ ] Commit a synthetic state change before dropping its response; a retry that creates a duplicate durable effect fails the operation's idempotency contract.

- [ ] Return a partial response or ambiguous timeout; misreporting a completed operation as safely absent, or treating an incomplete response as success, fails outcome handling.

- [ ] Remove the injected fault and observe pools, queues and admission controls; leaked resources, a stuck breaker or unrecovered healthy requests fail the recovery gate.

- [ ] Trip the exercise stop condition and verify fault removal and traffic cessation; an injector that remains active or touches an unlisted target invalidates the rehearsal.

Workflow: https://undominated.ai/workflows/#exercise-service-timeouts
