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

dlmarion pushed a commit to branch 2.1
in repository https://gitbox.apache.org/repos/asf/accumulo.git


The following commit(s) were added to refs/heads/2.1 by this push:
     new b41427dc18 Used Retry to backoff when processing tablet locator 
failures (#3380)
b41427dc18 is described below

commit b41427dc18c9fa36c9e619ebf928a02aebeb22fb
Author: Dave Marion <dlmar...@apache.org>
AuthorDate: Fri May 5 15:09:49 2023 -0400

    Used Retry to backoff when processing tablet locator failures (#3380)
    
    
    Closes #3323
---
 .../core/clientImpl/TabletServerBatchReaderIterator.java       | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git 
a/core/src/main/java/org/apache/accumulo/core/clientImpl/TabletServerBatchReaderIterator.java
 
b/core/src/main/java/org/apache/accumulo/core/clientImpl/TabletServerBatchReaderIterator.java
index 890e8f853d..963a9f2c4a 100644
--- 
a/core/src/main/java/org/apache/accumulo/core/clientImpl/TabletServerBatchReaderIterator.java
+++ 
b/core/src/main/java/org/apache/accumulo/core/clientImpl/TabletServerBatchReaderIterator.java
@@ -18,6 +18,8 @@
  */
 package org.apache.accumulo.core.clientImpl;
 
+import static java.util.concurrent.TimeUnit.MILLISECONDS;
+import static java.util.concurrent.TimeUnit.MINUTES;
 import static java.util.concurrent.TimeUnit.SECONDS;
 
 import java.io.IOException;
@@ -77,6 +79,7 @@ import org.apache.accumulo.core.trace.TraceUtil;
 import org.apache.accumulo.core.util.ByteBufferUtil;
 import org.apache.accumulo.core.util.HostAndPort;
 import org.apache.accumulo.core.util.OpTimer;
+import org.apache.accumulo.core.util.Retry;
 import org.apache.thrift.TApplicationException;
 import org.apache.thrift.TException;
 import org.apache.thrift.transport.TTransportException;
@@ -248,6 +251,10 @@ public class TabletServerBatchReaderIterator implements 
Iterator<Entry<Key,Value
 
     int lastFailureSize = Integer.MAX_VALUE;
 
+    Retry retry = Retry.builder().infiniteRetries().retryAfter(100, 
MILLISECONDS)
+        .incrementBy(100, MILLISECONDS).maxWait(10, 
SECONDS).backOffFactor(1.07)
+        .logInterval(1, MINUTES).createFactory().createRetry();
+
     while (true) {
 
       binnedRanges.clear();
@@ -275,10 +282,11 @@ public class TabletServerBatchReaderIterator implements 
Iterator<Entry<Key,Value
         }
 
         try {
-          Thread.sleep(100);
+          retry.waitForNextAttempt(log, "binRanges retry failures");
         } catch (InterruptedException e) {
           throw new RuntimeException(e);
         }
+
       }
 
     }

Reply via email to