Skip to content

Add configurable half-open probe request count to CircuitBreaker #751

Description

@Kingsman-99

Description

CircuitBreaker transitions directly from open to closed after a reset timeout, without a half-open probe phase. If the downstream service is still degraded, the circuit immediately re-opens after a flood of requests.

Acceptance Criteria

  • Constructor accepts halfOpenProbeCount (default 1)
  • In half-open state, only halfOpenProbeCount requests are allowed through
  • All probes succeeding closes the circuit; any probe failing re-opens it immediately
  • Unit tests pass

Context

  • Target file: src/resilience/CircuitBreaker.ts
  • Probes beyond halfOpenProbeCount are rejected with a CircuitOpenError in half-open state

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions