GenericRandomErrorPlugin sends literal @dynamic in Retry-After for non-429 responses
Maintainer antworten meist innerhalb von 1 Tag
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 35/100
Rechercherichtung
Start in DevProxy.Plugins/Behavior/GenericRandomErrorPlugin.cs at the status-code check described in the issue, then inspect how RetryAfterPlugin is registered. Reproduce with the openai-throttling preset and confirm that dynamic Retry-After values are resolved for non-429 responses and that the resulting header is numeric.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Description
GenericRandomErrorPlugin only replaces @dynamic (and @dynamic=N) in the Retry-After header when the error response has status code 429. For any other status code, Dev Proxy sends the literal value @dynamic to the client.
APIs also send Retry-After on other status codes. For example, OpenAI returns 503 server_is_overloaded with Retry-After, and Anthropic returns 529 overloaded_error.
Source: DevProxy.Plugins/Behavior/GenericRandomErrorPlugin.cs, the if (error.StatusCode == (int)HttpStatusCode.TooManyRequests && ...) check.
Steps to reproduce
- Download the
openai-throttlingpreset:devproxy config get openai-throttling - Start Dev Proxy:
devproxy --config-file "~dataFolder/configs/openai-throttling/.devproxy/devproxyrc.json" --failure-rate 100 - Send requests until you get a 503:
curl -ikx http://127.0.0.1:8000 https://api.openai.com/v1/models
Expected behavior
HTTP/1.1 503 Service Unavailable
Retry-After: 5
Actual behavior
HTTP/1.1 503 Service Unavailable
Retry-After: @dynamic
Clients can't parse the header, so they fall back to their own backoff. RetryAfterPlugin doesn't check whether the app waited.
Affected presets
openai-throttling(503)anthropic-random-errors(529)anthropic-throttling(529)api-degradation-scenarios(503)webhook-delivery-resilience(503)
Proposed fix
Resolve @dynamic in the Retry-After header for any status code, and register the request with RetryAfterPlugin whenever the response has a @dynamic Retry-After header.
The other option is to keep the current behavior, show a warning when @dynamic is used on a status other than 429, and change the presets to use a number.
- Vorherrschende Sprache
- C#
- Sterne
- 838
- Forks
- 90
- Ø Merge
- 2 T. 8 Std.
- Gemergte PRs (30 T.)
- 67
Entwicklungsumgebung
- Enthält ein Dockerfile oder eine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus dotnet/dev-proxy
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 65/100
Maintainer antworten meist innerhalb von 1 Tag
-
MockStdioResponsePlugin: @stdin.body.id placeholder fails to resolve when messages arrive back-to-back after an id-less messageEvtl. wieder frei @garrytrinder hat das vor 106 Tagen übernommen, und es ist kein Pull Request offen. Offen
dotnet/dev-proxy#1757 · 1 Reaktion · 2 zugewiesene Personen ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 55/100
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in dotnet/dev-proxy
Ähnliche Issues
-
bug P2
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
microsoft/SimpleL7Proxy#302 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 82/100
QuantConnect/Lean#9957 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 65/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 77/100
Maintainer antworten meist innerhalb von 1 Tag