huaxingao commented on code in PR #18070:
URL: https://github.com/apache/iceberg/pull/18070#discussion_r4067762501
##########
core/src/main/java/org/apache/iceberg/rest/HTTPClient.java:
##########
@@ -164,6 +169,26 @@ public HTTPClient withAuthSession(AuthSession session) {
return new HTTPClient(this, session);
}
+ @VisibleForTesting
+ static Duration parseKeyLifetime(String lifetime) {
+ if (lifetime == null) {
+ return null;
+ }
+ try {
+ Duration parsed = Duration.parse(lifetime);
+ if (parsed.isZero()
+ || parsed.isNegative()
+ || parsed.compareTo(Duration.ofMillis(Long.MAX_VALUE)) > 0) {
+ LOG.warn("Ignoring out-of-range idempotency-key lifetime: {}",
lifetime);
+ return null;
Review Comment:
null turns the bound off. PT0S still enables Idempotency-Key, so we retry
with no window. Can we return Duration.ZERO for zero/negative instead?
--
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]