Skip to content

Add circuit breaker pattern to RetryQueue #7

@marcstraube

Description

@marcstraube

Context

RetryQueue retries with exponential backoff indefinitely. During prolonged outages, this wastes resources without fast-failing.

Goal

Circuit breaker state ("open") to fast-fail after sustained failures, with automatic recovery attempt after a cooldown period.

Implementation

  1. Track consecutive failure count
  2. Open circuit after N consecutive failures
  3. Reject immediately while circuit is open
  4. After cooldown, allow one probe request (half-open)
  5. Success closes circuit, failure reopens

Files

  • src/network/RetryQueue.ts
  • tests/network/RetryQueue.test.ts

Source: AUDIT4 (-1 Defense-in-Depth)

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort:mMedium (30 min - 2h)enhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions