ryankert01 opened a new pull request, #4192: URL: https://github.com/apache/iggy/pull/4192
## Which issue does this PR address? Closes #4168 ## Rationale `HttpRetryMiddleware` read `Retry-After` only on 429, but it retries any 5xx too. ## What changed? The middleware now reads `Retry-After` on every status it already retries, so a 503 is no longer retried with the server's own timing thrown away. InfluxDB OSS v2 documents the header on 503 and does not list 429, so the connector this middleware was written for hit that directly; InfluxDB Cloud uses 429, which is what the original code covered. A new `MAX_RETRY_AFTER` bounds the honored value at 6 hours, matching urllib3's `retry_after_max`. `max_delay` deliberately does not bound it, because a server asking for longer than we would have chosen is the case the header exists for. The bound guards against an absurd value, not against a stall: a connector asleep for hours needs an alert, not a smaller constant. Happy to take a different number. **Follow-up:** [`parse_retry_after`](https://github.com/apache/iggy/blob/90615962cbf058959c52bada7931411c328272e0/core/connectors/sdk/src/retry.rs#L173) accepts only the integer-seconds form, so the HTTP-date form that [RFC 9110 §10.2.3](https://www.rfc-editor.org/rfc/rfc9110.html#name-retry-after) also allows returns `None` and falls back to the computed backoff. Adding it needs an `httpdate` or `chrono` dependency, so it stays a separate PR. Tracked in #4168. ## Local Execution - Passed — `fmt`, `clippy -D warnings` on the SDK and the three connectors using `build_retry_client`, 174 SDK tests, `cargo doc` under `RUSTDOCFLAGS=-D warnings`. - Both regression tests confirmed failing against the old behaviour first. The other two new tests pin the bound's edges and pass either way; they guard a future value change rather than this one. - `prek` ran and passes, except `markdownlint`, `license-headers`, `trailing-whitespace`, `trailing-newline` and `binary-artifacts`, which need bash >= 4.2; ran those directly instead. ## AI Usage - Claude Code. - Implementation, tests and docs. - Local chain above; prior art checked against urllib3, OTLP, AWS SDK and the InfluxDB docs. - Yes. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
