HotSushi opened a new pull request, #18070: URL: https://github.com/apache/iceberg/pull/18070
## What / Why Follow-up to #17947 (client-side Idempotency-Key retries). #17947 auto-retries keyed POSTs on retriable errors but never honors the server-advertised key lifetime, so a slow retry can fire *after* the key has expired — when the server no longer dedupes — risking a duplicate mutation. The REST spec obligation on the client: > Clients SHOULD NOT reuse an Idempotency-Key after this window elapses. ## Change - `ExponentialHttpRequestRetryStrategy` now accepts the advertised key lifetime and declines a retry for a keyed request once the elapsed time since the first attempt plus the next retry interval would reach the lifetime window. Enforced on both the response and network-exception retry paths; non-keyed / idempotent requests are unaffected. - The lifetime advertised in `GET /v1/config` (ISO-8601, e.g. `PT30M`) is plumbed to the HTTP client through the client properties and parsed once in `HTTPClient`; a malformed value is ignored (disables enforcement) rather than failing client construction. - Extracted a shared `isRetrySafe(...)` predicate to remove duplication between the two retry paths (addresses a review nit; also clarifies that "retry-safe" is not the same as strictly idempotent). ## Tests Added unit tests in `TestExponentialHttpRequestRetryStrategy`: keyed retry abandoned once the window is exceeded (both response and network-exception paths), keyed retry honored within the window and when no lifetime is advertised, and an idempotent GET unaffected by the key lifetime. `:iceberg-core` `rest.*` tests pass locally. ## Notes - Client-only change; no OpenAPI/spec files touched (no vote needed). - Stacked on #17947, which has not merged yet — until it lands, this PR's diff also shows #17947's commits. - This change was developed with AI assistance (Claude), reviewed by the author. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
