From 2d93444cb0afad533c0a744cad296ef8fcfff5d2 Mon Sep 17 00:00:00 2001 From: stack Date: Thu, 30 Jun 2016 05:57:39 -0700 Subject: [PATCH] HBASE-16149 Log the underlying RPC exception in RpcRetryingCallerImpl (Jerry He) --- .../hbase/client/RpcRetryingCallerImpl.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RpcRetryingCallerImpl.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RpcRetryingCallerImpl.java index 8f287962001..cc2f159bb32 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RpcRetryingCallerImpl.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RpcRetryingCallerImpl.java @@ -104,16 +104,18 @@ public class RpcRetryingCallerImpl implements RpcRetryingCaller { throw e; } catch (Throwable 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. interceptor.handleFailure(context, 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); RetriesExhaustedException.ThrowableWithExtraContext qt = new RetriesExhaustedException.ThrowableWithExtraContext(t, @@ -131,7 +133,7 @@ public class RpcRetryingCallerImpl implements RpcRetryingCaller { long duration = singleCallDuration(expectedSleep); if (duration > callTimeout) { String msg = "callTimeout=" + callTimeout + ", callDuration=" + duration + - ": " + callable.getExceptionMessageAdditionalDetail(); + ": " + t.getMessage() + " " + callable.getExceptionMessageAdditionalDetail(); throw (SocketTimeoutException)(new SocketTimeoutException(msg).initCause(t)); } } finally {