Skip to content

Commit a676083

Browse files
committed
docs(resilience): document circuit breaker and error envelope
1 parent ac41035 commit a676083

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

docs/RESILIENCE.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Resilience & Error Handling
2+
3+
## Objectives
4+
- Prevent repeated failures from overwhelming dependencies.
5+
- Provide consistent, structured error responses.
6+
- Keep APIs responsive with safe fallbacks.
7+
8+
## Circuit Breaker
9+
- Guards model/database calls to short-circuit repeated errors.
10+
- States: `closed``open` (on threshold) → `half_open` (after cooldown).
11+
- Exposed via `/api/v1/health` under `components.inference_circuit`.
12+
13+
## Backoff & Retry
14+
- Exponential backoff using `compute_backoff_seconds`.
15+
- Limited retries with confidence-aware logic in the Text2SQL engine.
16+
17+
## Error Responses
18+
- All API errors use the `ErrorResponse` envelope with `code`, `message`, `details`, and `request_id`.
19+
20+
## Operations Tips
21+
- If CI hits pip "resolution-too-deep", install with constraints:
22+
```
23+
pip install -r requirements.txt -c constraints.txt
24+
```
25+
- Monitor health endpoint for `inference_circuit` status to detect downstream instability early.
26+

0 commit comments

Comments
 (0)