Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ public String toString() {
}
return joiner.toString();
}

public Throwable getThrowable() {
return throwable;
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import org.apache.hadoop.hbase.CallQueueTooBigException;
import org.apache.hadoop.hbase.DoNotRetryIOException;
import org.apache.hadoop.hbase.exceptions.PreemptiveFastFailException;
import org.apache.hadoop.hbase.quotas.RpcThrottlingException;
import org.apache.hadoop.hbase.util.EnvironmentEdgeManager;
import org.apache.hadoop.hbase.util.ExceptionUtil;
import org.apache.hadoop.ipc.RemoteException;
Expand Down Expand Up @@ -103,7 +104,13 @@ public T callWithRetries(RetryingCallable<T> callable, int callTimeout)
long expectedSleep;
try {
// bad cache entries are cleared in the call to RetryingCallable#throwable() in catch block
callable.prepare(tries != 0);
Throwable t = null;
if (exceptions != null && !exceptions.isEmpty()) {
t = exceptions.get(exceptions.size() - 1).getThrowable();
}
if (!(t instanceof RpcThrottlingException)) {
callable.prepare(tries != 0);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, the idea here is that if we got an exception and we are retrying, do NOT reload cache if the exception was a because we were throttled?

This is a good idea. I wonder if there are other exceptions where we retry but do not need to reload the cache?

interceptor.intercept(context.prepare(callable, tries));
return callable.call(getTimeout(callTimeout));
} catch (PreemptiveFastFailException e) {
Expand Down