Commit dc7db31
committed
feat(backend): enhance error recovery for Trustline Manager
- Replace single global circuit breaker with per-context registry so
failure domains are fully isolated (a Horizon surge won't block DB ops)
- Add half-open state: one probe attempt before re-closing the breaker
- Wrap every operation in a configurable hard timeout (default 15 s)
to prevent runaway async calls from stalling the retry loop
- Add in-memory dead-letter queue (capped at 100 entries) for
unrecoverable failures; expose getDeadLetterQueue / drainDeadLetterQueue
- Support pluggable fallback handlers so callers can return cached /
degraded data instead of bubbling an error to the client
- Expose getCircuitBreakerMetrics() for health/monitoring endpoints
- Extend error classification with timeout and auth error categories
- Add 27 new targeted tests (48 total, all passing) covering per-context
isolation, half-open probing, timeout, DLQ, and fallback behaviour
Closes #7461 parent 5a8a9ff commit dc7db31
2 files changed
Lines changed: 618 additions & 141 deletions
0 commit comments