Repository navigation
Conversation
c6b2a80 to
2e15601
Compare
| if (response.status_code != 0 || !safe || | ||
| !IsRetriableTransportError(response.error.code)) { | ||
| return false; |
There was a problem hiding this comment.
A nonzero status is available before the final header block is complete. A TCP reset in that window is still an execution-stage failure that Java retries for safe requests, but this condition suppresses it. Track final-header completion and add a partial-header reset test, while keeping body-read failures non-retryable.
There was a problem hiding this comment.
Fixed by tracking final-header completion explicitly. Partial-header resets can retry safe requests; body-read failures remain non-retryable. Added regression tests for both cases.
| return std::chrono::milliseconds(std::max<int64_t>(0, properties.Get(entry))); | ||
| }; | ||
| ICEBERG_ASSIGN_OR_RAISE(auto options, | ||
| HttpClientOptions::FromProperties(properties.configs())); |
There was a problem hiding this comment.
Pass the top-level idempotency-key-lifetime from /v1/config into the retry policy. Only let a key enable POST retries if the server advertises support. A server that ignores the key can apply the write twice.
There was a problem hiding this comment.
The top-level config field now controls key-based retries. Client properties, defaults and overrides cannot enable support or extend the advertised window. Added configuration and retry coverage.
| const auto elapsed = std::chrono::duration_cast<std::chrono::milliseconds>( | ||
| std::chrono::time_point_cast<std::chrono::milliseconds>(now) - first_attempt); | ||
| if (!attempt.retry_approved && | ||
| !ShouldRetry(attempt.response, request, exec_count, options, elapsed, now)) { |
There was a problem hiding this comment.
Keep the retry decision made at the end of the final headers. This second check lets a Retry-After trailer on a 503 replay a POST without an idempotency key.
There was a problem hiding this comment.
The retry decision is now fixed at final-header completion. A Retry-After trailer cannot enable a POST retry. Added a regression test.
| return std::move(attempt.response); | ||
| } | ||
| const auto delay = RetryInterval(attempt.response, exec_count, timing.now()); | ||
| if (delay > std::chrono::milliseconds::zero()) timing.sleep(delay); |
There was a problem hiding this comment.
Check the key's expiry again just before sending the retry. Response cleanup or an oversleep can take the next attempt past the server's reuse window.
There was a problem hiding this comment.
Expiry is checked after response cleanup and again after waiting, before resending.
| if (seconds > kMaxSeconds) return (std::chrono::milliseconds::max)(); | ||
| return std::chrono::milliseconds(seconds * 1000); | ||
| } | ||
| const auto date = curl_getdate(it->second.c_str(), nullptr); |
There was a problem hiding this comment.
Only accept HTTP-date formats here. curl_getdate accepts 01 Jan 2035, so an invalid Retry-After can make the client wait years. Use the normal backoff for that value.
cfabc7d to
c9b0908
Compare
Configure REST transport through rest.client.* properties for connection and socket timeouts, retry limits, user-agent and idempotency-key lifetime. Apply initial and merged catalog properties through the client factory, preserving custom factories and the existing timeout constructor. Use Java's three-minute default connection timeout and zero-value timeout semantics. Enforce response inactivity deadlines in milliseconds with a synchronous libcurl transfer loop, without an additional executor. Authenticate once and replay the same request across retries. Decide HTTP status retries after headers and before reading the entity. Honor Idempotency-Key for retry-safe requests and bound keyed retries by the first-send time and maximum next interval, including Retry-After or jitter. Parse key lifetimes as ISO-8601 durations with Java-compatible handling of invalid and non-positive values. Retry eligible request-execution I/O failures without a delay. Propagate final response-body failures without replaying the request. Preserve redirect protection, transfer-error reporting and commit-state-unknown handling. Saturate oversized Retry-After conversions without overflow and avoid echoing malformed OAuth token responses. Document the transport policy and add regression coverage for retry rules, key lifetime budgets, stable authentication, timeout precision and duration boundaries.
Inject retry timing for deterministic tests while preserving Java retry behavior. Cover connection reuse, shorten slow socket tests, share timeout defaults and clarify legacy timeout naming and documentation.
Protect min/max calls from Windows SDK macros. Fix clang-tidy findings in transport code and retry tests while retaining libcurl native integer types and Java retry behavior.
Restore the upstream token-response parser and keep the targeted validation-error fix and regression coverage in PR apache#1079.
Honor the server-advertised idempotency window and recheck expiry before retrying. Freeze HTTP status retry decisions at final headers while allowing safe retries after partial-header resets. Restrict Retry-After dates to HTTP-date formats, correct the storage credentials link, and add transport, configuration and concurrency regression coverage.
Use designated initializers for partial-header retry cases. Document and retain the long type required by CURLINFO_REQUEST_SIZE, including on Windows.
acf032f to
e7364b0
Compare
Configure REST transport through rest.client.* properties for connection and socket timeouts, retry limits, user-agent and idempotency-key lifetime. Apply initial and merged catalog properties through the client factory, preserving custom factories and the existing timeout constructor.
Use Java's three-minute default connection timeout and zero-value timeout semantics. Enforce response inactivity deadlines in milliseconds with a synchronous libcurl transfer loop, without an additional executor.
Authenticate once and replay the same request across retries. Decide HTTP status retries after headers and before reading the entity. Honor Idempotency-Key for retry-safe requests and bound keyed retries by the first-send time and maximum next interval, including Retry-After or jitter. Parse key lifetimes as ISO-8601 durations with Java-compatible handling of invalid and non-positive values.
Retry eligible request-execution I/O failures without a delay. Propagate final response-body failures without replaying the request. Preserve redirect protection, transfer-error reporting and commit-state-unknown handling. Saturate oversized Retry-After conversions without overflow and avoid echoing malformed OAuth token responses.
Document the transport policy and add regression coverage for retry rules, key lifetime budgets, stable authentication, timeout precision and duration boundaries.