Operational: No circuit breaker pattern for failing providers #92

Open
opened 2026-05-11 13:48:53 +00:00 by thabeta · 0 comments
Owner

Severity: Medium

Location

crates/hero_aibroker_lib/src/providers/keypool.rs

Finding

The KeyPool has health tracking per key but no circuit breaker pattern:

  • Keys are marked with FailureKind and backoff
  • No tripping threshold that removes a provider entirely
  • No half-open state for recovery testing
  • Failed providers continue receiving traffic (on less-preferred keys)

Impact

  • A provider experiencing a partial outage continues receiving requests
  • Requests fail slowly (waiting for timeout) instead of failing fast
  • No automatic isolation of unhealthy providers

Recommendation

  • Implement circuit breaker states: Closed → Open → Half-Open
  • Trip the circuit after N consecutive failures
  • Periodically test half-open circuits with probe requests
## Severity: Medium ## Location `crates/hero_aibroker_lib/src/providers/keypool.rs` ## Finding The KeyPool has health tracking per key but no circuit breaker pattern: - Keys are marked with `FailureKind` and backoff - No tripping threshold that removes a provider entirely - No half-open state for recovery testing - Failed providers continue receiving traffic (on less-preferred keys) ## Impact - A provider experiencing a partial outage continues receiving requests - Requests fail slowly (waiting for timeout) instead of failing fast - No automatic isolation of unhealthy providers ## Recommendation - Implement circuit breaker states: Closed → Open → Half-Open - Trip the circuit after N consecutive failures - Periodically test half-open circuits with probe requests
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_aibroker#92
No description provided.