HBASE-16149 Log the underlying RPC exception in RpcRetryingCallerImpl (Jerry He)

This commit is contained in:
stack 2016-06-30 05:57:39 -07:00
parent e2566eb0ee
commit 2d93444cb0
1 changed files with 9 additions and 7 deletions

View File

@ -104,16 +104,18 @@ public class RpcRetryingCallerImpl<T> implements RpcRetryingCaller<T> {
throw e; throw e;
} catch (Throwable t) { } catch (Throwable t) {
ExceptionUtil.rethrowIfInterrupt(t); ExceptionUtil.rethrowIfInterrupt(t);
if (tries > startLogErrorsCnt) {
LOG.info("Call exception, tries=" + tries + ", maxAttempts=" + maxAttempts + ", started="
+ (EnvironmentEdgeManager.currentTime() - tracker.getStartTime()) + " ms ago, "
+ "cancelled=" + cancelled.get() + ", msg="
+ callable.getExceptionMessageAdditionalDetail());
}
// translateException throws exception when should not retry: i.e. when request is bad. // translateException throws exception when should not retry: i.e. when request is bad.
interceptor.handleFailure(context, t); interceptor.handleFailure(context, t);
t = translateException(t); t = translateException(t);
if (tries > startLogErrorsCnt) {
LOG.info("Call exception, tries=" + tries + ", maxAttempts=" + maxAttempts + ", started="
+ (EnvironmentEdgeManager.currentTime() - tracker.getStartTime()) + " ms ago, "
+ "cancelled=" + cancelled.get() + ", msg="
+ t.getMessage() + " " + callable.getExceptionMessageAdditionalDetail());
}
callable.throwable(t, maxAttempts != 1); callable.throwable(t, maxAttempts != 1);
RetriesExhaustedException.ThrowableWithExtraContext qt = RetriesExhaustedException.ThrowableWithExtraContext qt =
new RetriesExhaustedException.ThrowableWithExtraContext(t, new RetriesExhaustedException.ThrowableWithExtraContext(t,
@ -131,7 +133,7 @@ public class RpcRetryingCallerImpl<T> implements RpcRetryingCaller<T> {
long duration = singleCallDuration(expectedSleep); long duration = singleCallDuration(expectedSleep);
if (duration > callTimeout) { if (duration > callTimeout) {
String msg = "callTimeout=" + callTimeout + ", callDuration=" + duration + String msg = "callTimeout=" + callTimeout + ", callDuration=" + duration +
": " + callable.getExceptionMessageAdditionalDetail(); ": " + t.getMessage() + " " + callable.getExceptionMessageAdditionalDetail();
throw (SocketTimeoutException)(new SocketTimeoutException(msg).initCause(t)); throw (SocketTimeoutException)(new SocketTimeoutException(msg).initCause(t));
} }
} finally { } finally {