fix(proxy): clear expired retry cooldown transitions - #1908
Conversation
A persisted retry-circuit row with an elapsed (or absent) cooldown currently reloads its deadline as a non-zero monotonic timestamp in the past. The admission check interprets that state as a cooldown that just ended, consumes the exclusive half-open lease, and suppresses subsequent requests for the lease duration even though no cooldown remains. Normalize non-positive remaining durable cooldowns to the zero sentinel while preserving future deadlines. Add a regression proving elapsed rows do not burn a lease; thresholds, backoff, persistence, and ownership behavior remain unchanged.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
Included review availability: Your plan provides up to 10 included reviews per hour; 2 remain after this review. 📝 WalkthroughWalkthroughThe retry circuit now restores elapsed or absent durable cooldowns as an open state with no cooldown or half-open lease. Equal-version reloads clear stale local deadlines. Specifications and unit tests document and verify the behavior. ChangesRetry cooldown normalization
Estimated code review effort: 2 (Simple) | ~15 minutes Merge Risk: ⚪ Minimal · up to This localized change clears expired retry cooldown state while preserving newer failures and persisted state; the supplied checks pass, and no actionable merge-blocking risk remains beyond normal review. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
Follow-up on the expiry-transition review: commit ed8ee12 also clears a stale half-open lease when an equal-or-newer expired durable snapshot arrives after a transient lookup failure. Added regression coverage for future row -> lookup failure/lease -> same-version expired row. The branch is based directly on beta.4 main b311aea; no #1867 dependency. Affected gates pass: 37 retry-circuit tests, Ruff, format, ty, architecture, diff check, and strict scoped OpenSpec. |
Problem
A durable retry-circuit cooldown that expired after being loaded could leave a stale positive monotonic deadline in local state. Admission interpreted that expiry as a half-open transition and consumed the exclusive probe lease, suppressing later requests. A transient lookup failure could also create that probe lease; a subsequent same-version expired row cleared only the cooldown and left the lease active.
What this fixes
Expired durable cooldowns now clear equal-version stale local cooldown and half-open deadlines when no newer local failure exists. Newer local failures and newer persisted state remain authoritative.
What is now possible
After a persisted cooldown expires, including recovery from a transient lookup failure, ordinary retry admission remains open without creating or retaining a half-open probe lease. Future cooldowns continue to be enforced.
Tests
Dependencies
Based directly on beta.4 upstream main b311aea. No dependency on PR #1867; the branches are independent. This PR changes only retry-circuit state merge logic and its regression tests.