Repository navigation
Honor stated retry times (add-retry-after) - #115
Merged
Merged
Conversation
A 429 or 503 whose error body states when the endpoint will serve again cools the endpoint for exactly that long, at once, clamped to 1 s to [health] max_retry_after_secs (default 300). Read from the body for a few well-known phrasings until Switchyard exposes Retry-After (Switchyard#904). Cooldown source in /v1/health and explain, retry_after_ms on decision attempts, humpyard_retry_after_honored_total. Amends ADR 0018. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Gary Schaetz <gary@schaetzkc.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Gary Schaetz <gary@schaetzkc.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements the spec merged in #114 (
add-retry-after), step 1 of Replacing ModelRelay. No release is cut here.Behavior
retryDelay,retry_after, ...) cools the endpoint at once for exactly that long, clamped to 1 second ..[health] max_retry_after_secs(new, default 300, validated 1 to 86400). It does not wait forfailure_threshold, does not double, is not held tomax_cooldown_secs, and does not count as a trip, so a later unannounced failure streak is not escalated by it.retry_after::from_body, where theRetry-Afterheader joins once Switchyard exposes it (fix(server): preserve safe headers on terminal upstream errors NVIDIA-NeMo/Switchyard#904, which I added a use case to).cooldown_source(retry_afterorfailures) inGET /v1/healthandroute/explain;retry_after_mson decision attempts (inside the existing attempts column, no schema change); counterhumpyard_retry_after_honored_total{provider,source}.Tests
Parser unit tests (phrasings, JSON fields, units and combinations, bare numbers, junk, zero and negative, a day, a body past 4 KiB, a multibyte character at the limit), breaker unit tests (exact duration, no doubling or cap, late failures, failed probe, no escalation, disabled breaker), and 9 end-to-end tests with a controllable clock: cooled at once for the stated time and probed exactly then, the cap, the one-second floor, 503, hint-less failures unchanged, a 500 mentioning a time ignored, metrics and decision fields, fail-open, config validation. The architecture-rules test gains the new module. Local gates: fmt, clippy
-D warnings, 452 tests,cargo deny.🤖 Generated with Claude Code