Skip to content

[RESILIENCE] Circuit breaker pattern — prevent cascading failures when dependencies are slow/unavailable #220

@ElioNeto

Description

@ElioNeto

Description

When external dependencies (disk, network, storage) are slow or failing, ApexStore should fail fast instead of queuing requests that will time out anyway.

Implementation

  1. Add CircuitBreaker wrapper around critical I/O paths (WAL fsync, SSTable reads, compaction)
  2. Configurable thresholds: failure count, timeout window, half-open retry interval
  3. States: CLOSED (normal), OPEN (fail fast), HALF_OPEN (test recovery)
  4. Expose circuit state in /metrics endpoint
  5. Log state transitions for alerting

Configuration

resilience:
  circuit_breaker:
    wal_fsync:
      failure_threshold: 5
      timeout_ms: 10000
      half_open_after_ms: 30000
    compaction:
      failure_threshold: 3
      timeout_ms: 60000

Labels

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions