HBASE-26955 Improvement of the pause time between retries in Rpc caller
This commit is contained in:
parent
f990f56e8e
commit
4032a1bab4
|
@ -34,11 +34,13 @@ import java.util.function.Supplier;
|
|||
import org.apache.hadoop.hbase.DoNotRetryIOException;
|
||||
import org.apache.hadoop.hbase.HBaseServerException;
|
||||
import org.apache.hadoop.hbase.NotServingRegionException;
|
||||
import org.apache.hadoop.hbase.PleaseHoldException;
|
||||
import org.apache.hadoop.hbase.TableName;
|
||||
import org.apache.hadoop.hbase.TableNotEnabledException;
|
||||
import org.apache.hadoop.hbase.TableNotFoundException;
|
||||
import org.apache.hadoop.hbase.exceptions.ScannerResetException;
|
||||
import org.apache.hadoop.hbase.ipc.HBaseRpcController;
|
||||
import org.apache.hadoop.hbase.ipc.ServerNotRunningYetException;
|
||||
import org.apache.hadoop.hbase.util.EnvironmentEdgeManager;
|
||||
import org.apache.hadoop.hbase.util.FutureUtils;
|
||||
import org.apache.yetus.audience.InterfaceAudience;
|
||||
|
@ -139,6 +141,10 @@ public abstract class AsyncRpcRetryingCaller<T> {
|
|||
} else {
|
||||
delayNs = getPauseTime(pauseNsToUse, tries - 1);
|
||||
}
|
||||
if (!(error instanceof ServerNotRunningYetException || error instanceof PleaseHoldException)) {
|
||||
// when the error does not imply dead server, do not use the retry backoff factor
|
||||
delayNs = Math.min(delayNs, pauseNsToUse);
|
||||
}
|
||||
tries++;
|
||||
retryTimer.newTimeout(t -> doCall(), delayNs, TimeUnit.NANOSECONDS);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue