Skip to content

docs: document failure-domain sharing and half-open throttle semantics#31

Closed
costela wants to merge 1 commit into
fix/reject-oversize-halfopen-delayfrom
docs/failure-domain-and-throttle-notes
Closed

docs: document failure-domain sharing and half-open throttle semantics#31
costela wants to merge 1 commit into
fix/reject-oversize-halfopen-delayfrom
docs/failure-domain-and-throttle-notes

Conversation

@costela

@costela costela commented Jun 26, 2026

Copy link
Copy Markdown
Member

Stacked on #28 (reject over-size half-open delay) because both edit the WithHalfOpenDelay doc block — review/merge #28 first. Base retargets to main automatically once #28 merges.

What

Documents two surprising-but-intentional behaviors.

Why

Neither was written down, and both can bite:

  • Failure-domain sharing (Wrap): one Circuit can wrap many functions, which then share one openedAt and one failure rate — a failure in one opens the circuit for all. Now documents: wrap same-dependency methods together; use separate circuits for independent dependencies.
  • Half-open throttle (WithHalfOpenDelay): it throttles probe launch rate, not in-flight count. Against a slow dependency this can yield multiple concurrent probes. Now points at ConcurrencyLimiter for in-flight bounding.

Notes

Docs-only; no code behavior change.

🤖 Generated with Claude Code

Two surprising-but-intentional behaviors were undocumented:

- Wrap: one Circuit can wrap many functions, which then share a single
  failure domain (state and failure rate). A failure in one opens the
  circuit for all of them. Document wrapping same-dependency functions
  together and using separate circuits for independent dependencies.

- WithHalfOpenDelay: the half-open throttle is launch-rate based, not
  in-flight based. Each probe resets the delay, so a new probe is admitted
  roughly every delay regardless of whether the previous returned; against a
  slow dependency this can mean multiple concurrent in-flight probes. Point
  users at ConcurrencyLimiter to bound concurrent probes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@costela costela marked this pull request as ready for review June 26, 2026 18:54
@costela costela deleted the branch fix/reject-oversize-halfopen-delay June 26, 2026 19:01
@costela costela closed this Jun 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant