rmdmattingly commented on code in PR #5275:
URL: https://github.com/apache/hbase/pull/5275#discussion_r1237284606


##########
hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncBatchRpcRetryingCaller.java:
##########
@@ -465,27 +465,40 @@ private void onError(Map<byte[], RegionRequest> 
actionsByRegion, int tries, Thro
     List<Action> copiedActions = actionsByRegion.values().stream().flatMap(r 
-> r.actions.stream())
       .collect(Collectors.toList());
     addError(copiedActions, error, serverName);
-    tryResubmit(copiedActions.stream(), tries, error instanceof 
RetryImmediatelyException,
-      HBaseServerException.isServerOverloaded(error));
+    tryResubmit(copiedActions.stream(), tries, error instanceof 
RetryImmediatelyException, error);
   }
 
   private void tryResubmit(Stream<Action> actions, int tries, boolean 
immediately,
-    boolean isServerOverloaded) {
+    Throwable error) {
     if (immediately) {
       groupAndSend(actions, tries);
       return;
     }
+
+    boolean isServerOverloaded = 
HBaseServerException.isServerOverloaded(error);
+    OptionalLong maybePauseNsToUse =
+      pauseManager.getPauseNsFromException(error, remainingTimeNs() - 
SLEEP_DELTA_NS);
+    if (!maybePauseNsToUse.isPresent()) {
+      failAll(actions, tries);
+      return;
+    }
+    long pauseNsToUse = maybePauseNsToUse.getAsLong();
+    if (!(error instanceof RpcThrottlingException)) {
+      // RpcThrottlingException tells us exactly how long the client should 
wait for,
+      // so we should not factor in the retry count for said exception
+      pauseNsToUse = getPauseTime(pauseNsToUse, tries - 1);

Review Comment:
   The small distinction is that they may still differ if the requested pause 
is longer than the operationTimeout allows



-- 
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]

Reply via email to