This is an automated email from the ASF dual-hosted git repository.

russellspitzer pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iceberg.git


The following commit(s) were added to refs/heads/main by this push:
     new 1d4df34d7b Core: Log retry sleep time (#11413)
1d4df34d7b is described below

commit 1d4df34d7bd06f6f69856aec15a1a94ae104c605
Author: sullis <[email protected]>
AuthorDate: Thu Oct 31 14:33:14 2024 -0700

    Core: Log retry sleep time (#11413)
---
 core/src/main/java/org/apache/iceberg/util/Tasks.java | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/core/src/main/java/org/apache/iceberg/util/Tasks.java 
b/core/src/main/java/org/apache/iceberg/util/Tasks.java
index 14804e0407..29100c6cff 100644
--- a/core/src/main/java/org/apache/iceberg/util/Tasks.java
+++ b/core/src/main/java/org/apache/iceberg/util/Tasks.java
@@ -454,11 +454,13 @@ public class Tasks {
                   Math.min(
                       minSleepTimeMs * Math.pow(scaleFactor, attempt - 1), 
(double) maxSleepTimeMs);
           int jitter = ThreadLocalRandom.current().nextInt(Math.max(1, (int) 
(delayMs * 0.1)));
+          int sleepTimeMs = delayMs + jitter;
 
-          LOG.warn("Retrying task after failure: {}", e.getMessage(), e);
+          LOG.warn(
+              "Retrying task after failure: sleepTimeMs={} {}", sleepTimeMs, 
e.getMessage(), e);
 
           try {
-            TimeUnit.MILLISECONDS.sleep(delayMs + jitter);
+            TimeUnit.MILLISECONDS.sleep(sleepTimeMs);
           } catch (InterruptedException ie) {
             Thread.currentThread().interrupt();
             throw new RuntimeException(ie);

Reply via email to