Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add circuit breaker pattern for database operations #712

Closed
augchan42 opened this issue Nov 30, 2024 · 0 comments · Fixed by #812
Closed

feat: Add circuit breaker pattern for database operations #712

augchan42 opened this issue Nov 30, 2024 · 0 comments · Fixed by #812
Labels
enhancement New feature or request

Comments

@augchan42
Copy link
Contributor

Implements a circuit breaker pattern to handle database failures gracefully and prevent cascading failures. This change:

  • Adds CircuitBreaker class with CLOSED, OPEN, and HALF-OPEN states
  • Introduces BaseCircuitBreakerAdapter for database adapters
  • Configurable failure thresholds and recovery timeouts
  • Automatic recovery attempts in HALF-OPEN state
  • Detailed logging of circuit breaker state changes

The circuit breaker will:

  • Open after 5 consecutive failures (configurable)
  • Reset after 60 seconds in OPEN state
  • Require 3 successful operations in HALF-OPEN state to close

This helps prevent overwhelming failed database connections and provides
graceful degradation during outages.

@augchan42 augchan42 added the enhancement New feature or request label Nov 30, 2024
augchan42 added a commit to augchan42/eliza that referenced this issue Nov 30, 2024
Implements circuit breaker pattern to handle database failures gracefully
and prevent cascading failures. Fixes elizaOS#712.

Changes:
- Adds CircuitBreaker class with CLOSED, OPEN, and HALF-OPEN states
- Introduces BaseCircuitBreakerAdapter for database adapters
- Configurable failure thresholds and recovery timeouts
- Automatic recovery attempts in HALF-OPEN state
- Detailed logging of circuit breaker state changes

Circuit breaker configuration:
- Opens after 5 consecutive failures (configurable)
- Resets after 60 seconds in OPEN state
- Requires 3 successful operations in HALF-OPEN state to close

This helps prevent overwhelming failed database connections and provides
graceful degradation during outages.
augchan42 added a commit to augchan42/eliza that referenced this issue Nov 30, 2024
Implements circuit breaker pattern to handle database failures gracefully
and prevent cascading failures. Fixes elizaOS#712.

Changes:
- Adds CircuitBreaker class with CLOSED, OPEN, and HALF-OPEN states
- Introduces BaseCircuitBreakerAdapter for database adapters
- Configurable failure thresholds and recovery timeouts
- Automatic recovery attempts in HALF-OPEN state
- Detailed logging of circuit breaker state changes

Circuit breaker configuration:
- Opens after 5 consecutive failures (configurable)
- Resets after 60 seconds in OPEN state
- Requires 3 successful operations in HALF-OPEN state to close

This helps prevent overwhelming failed database connections and provides
graceful degradation during outages.
augchan42 added a commit to augchan42/eliza that referenced this issue Nov 30, 2024
Implements circuit breaker pattern to handle database failures gracefully
and prevent cascading failures. Fixes elizaOS#712.

Changes:
- Adds CircuitBreaker class with CLOSED, OPEN, and HALF-OPEN states
- Introduces BaseCircuitBreakerAdapter for database adapters
- Configurable failure thresholds and recovery timeouts
- Automatic recovery attempts in HALF-OPEN state
- Detailed logging of circuit breaker state changes

Circuit breaker configuration:
- Opens after 5 consecutive failures (configurable)
- Resets after 60 seconds in OPEN state
- Requires 3 successful operations in HALF-OPEN state to close

This helps prevent overwhelming failed database connections and provides
graceful degradation during outages.
augchan42 added a commit to augchan42/eliza that referenced this issue Nov 30, 2024
Implements circuit breaker pattern to handle database failures gracefully
and prevent cascading failures. Fixes elizaOS#712.

Changes:
- Adds CircuitBreaker class with CLOSED, OPEN, and HALF-OPEN states
- Introduces BaseCircuitBreakerAdapter for database adapters
- Configurable failure thresholds and recovery timeouts
- Automatic recovery attempts in HALF-OPEN state
- Detailed logging of circuit breaker state changes

Circuit breaker configuration:
- Opens after 5 consecutive failures (configurable)
- Resets after 60 seconds in OPEN state
- Requires 3 successful operations in HALF-OPEN state to close

This helps prevent overwhelming failed database connections and provides
graceful degradation during outages.
augchan42 added a commit to augchan42/eliza that referenced this issue Nov 30, 2024
Implements circuit breaker pattern to handle database failures gracefully
and prevent cascading failures. Fixes elizaOS#712.

Changes:
- Adds CircuitBreaker class with CLOSED, OPEN, and HALF-OPEN states
- Introduces BaseCircuitBreakerAdapter for database adapters
- Configurable failure thresholds and recovery timeouts
- Automatic recovery attempts in HALF-OPEN state
- Detailed logging of circuit breaker state changes

Circuit breaker configuration:
- Opens after 5 consecutive failures (configurable)
- Resets after 60 seconds in OPEN state
- Requires 3 successful operations in HALF-OPEN state to close

This helps prevent overwhelming failed database connections and provides
graceful degradation during outages.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment