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


##########
hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncScanSingleRegionRpcRetryingCaller.java:
##########
@@ -418,19 +416,14 @@ private void onError(Throwable error) {
       completeExceptionally(!scannerClosed);
       return;
     }
-    long delayNs;
-    long pauseNsToUse =
-      HBaseServerException.isServerOverloaded(error) ? 
pauseNsForServerOverloaded : pauseNs;
-    if (scanTimeoutNs > 0) {
-      long maxDelayNs = remainingTimeNs() - SLEEP_DELTA_NS;
-      if (maxDelayNs <= 0) {
-        completeExceptionally(!scannerClosed);
-        return;
-      }
-      delayNs = Math.min(maxDelayNs, getPauseTime(pauseNsToUse, tries - 1));
-    } else {
-      delayNs = getPauseTime(pauseNsToUse, tries - 1);
+
+    OptionalLong maybePauseNsToUse = 
pauseManager.getPauseNsFromException(error,
+      remainingTimeNs() - SLEEP_DELTA_NS, tries, scanTimeoutNs > 0);

Review Comment:
   Passing in `scanTimeoutNs > 0` along with the `remainingTimeNs()` seems a 
bit awkward/redundant. 
   
   We are already constructing our PauseManager in the caller construction, and 
passing in the various pauseNs. Should we also pass in the correct 
operationTimeNs/scanTimeNs in the constructor? Then we can move 
`remainingTimeNs()` into pause manager and simplify the arguments here, along 
with the awkward Boolean?



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