wombatu-kun commented on code in PR #17013:
URL: https://github.com/apache/iceberg/pull/17013#discussion_r3497489373
##########
core/src/main/java/org/apache/iceberg/hadoop/HadoopTableOperations.java:
##########
@@ -350,6 +367,76 @@ int findVersion() {
}
}
+ private Integer retryReadVersionHint(FileSystem fs, Path versionHintFile) {
Review Comment:
`retryReadVersionHint` and `sleepBeforeVersionHintRetry` reimplement retry,
capped exponential backoff, and re-interrupt-then-throw that
`org.apache.iceberg.util.Tasks` already provides (its `exponentialBackoff(min,
max, totalTimeout, scale)` plus the sleep/interrupt handling in
`runSingleThreaded`, which does the same `Thread.currentThread().interrupt();
throw new RuntimeException(...)`). AGENTS.md lists `Tasks.foreach` as the
standard retry utility and this package already uses it in `HadoopFileIO`.
Consider
`Tasks.foreach(versionHintFile).retry(numRetries).exponentialBackoff(initialWaitMs,
maxWaitMs, totalTimeoutMs, 2.0).onlyRetryOn(IOException.class).run(...)`,
falling back to the metadata listing in the catch when retries are exhausted.
`onlyRetryOn(IOException.class)` also avoids retrying a deterministic parse
failure (NumberFormatException from a corrupt hint), which the current `catch
(Exception)` re-reads with full backoff.
--
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]