Fix half-open circuit breaker retry handling#120
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughRefactors circuit breaker from simple Allow check to an acquire-based approach returning (bool, bool) indicating permission and half-open probe status. Implements probe short-circuiting in DoRaw and retry logic to prevent concurrent probes during open states. Adds comprehensive tests for retry-circuit-breaker interactions and half-open probe behavior. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant CB as CircuitBreaker
participant Retry
participant Upstream
Client->>CB: acquire()
alt Circuit Open (Half-Open Probe)
CB-->>Client: (true, true)<br/>allowed=true, isProbe=true
Client->>Upstream: send request
Upstream-->>Client: error/status
Client->>Retry: check if retryable
alt Retryable + In Probe
Retry->>Client: invoke end-hook<br/>return last error
end
else Circuit Closed
CB-->>Client: (true, false)
Client->>Upstream: send request
Upstream-->>Client: response
alt Failure + Retryable
Client->>Retry: attempt retry
Retry->>CB: acquire()
CB-->>Retry: (allow, probe)
end
else Circuit Open (Blocked)
CB-->>Client: (false, _)
Client->>Client: invoke end-hook<br/>return last error
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Summary by CodeRabbit