Skip to content

Implement circuit breaker pattern to prevent cascading failures#691

Merged
smahima27 merged 4 commits intomainfrom
P4DEVOPS-9438-circuit-breaker
Mar 9, 2026
Merged

Implement circuit breaker pattern to prevent cascading failures#691
smahima27 merged 4 commits intomainfrom
P4DEVOPS-9438-circuit-breaker

Conversation

@smahima27
Copy link
Contributor

  • Implement circuit breaker pattern to prevent cascading failures

    • Opens after 5 consecutive failures (configurable)
    • Half-open testing after 30s timeout
    • Fail-fast to prevent thread exhaustion
  • Add adaptive timeout mechanism

    • Adjusts based on p95 latency + 50% buffer
    • Reduces timeout on failures for faster fail
    • Bounded by configurable min/max values
  • Add connection pool health monitoring

    • Track utilization, waiting threads, available connections
    • Emit metrics for critical/warning states
    • Monitor circuit breaker and timeout stats
  • Integrate into base provider class

    • Auto-initialize if enabled in config
    • Provider-specific settings override global defaults
    • Backward compatible (enabled by default)
  • Add configuration options to vmpooler.yaml.example

    • circuit_breaker_* settings
    • connection_pool_timeout_* settings
    • connection_pool_monitor_* settings

Addresses cascading failure scenario where provider outages cause
thread exhaustion and system-wide outage despite other providers
being healthy. Enables graceful degradation and auto-recovery.

@smahima27 smahima27 requested a review from a team as a code owner December 26, 2025 11:41
@smahima27 smahima27 added the enhancement New feature or request label Mar 9, 2026
@smahima27 smahima27 force-pushed the P4DEVOPS-9438-circuit-breaker branch from df0a111 to 7449f23 Compare March 9, 2026 09:51
@smahima27 smahima27 merged commit 21c261f into main Mar 9, 2026
4 checks passed
@smahima27 smahima27 deleted the P4DEVOPS-9438-circuit-breaker branch March 9, 2026 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants