You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by zh...@apache.org on 2018/07/03 02:21:51 UTC

hbase git commit: HBASE-20826 Truncate really long RpcServer warnings unless TRACE is on

Repository: hbase
Updated Branches:
  refs/heads/master cfdabe926 -> 13e4578be


HBASE-20826 Truncate really long RpcServer warnings unless TRACE is on

Signed-off-by: zhangduo <zh...@apache.org>
Signed-off-by: Ted Yu <ty...@apache.org>
Signed-off-by: Michael Stack <st...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/13e4578b
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/13e4578b
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/13e4578b

Branch: refs/heads/master
Commit: 13e4578be83bd3e76ff1cfc5212ae75de130a007
Parents: cfdabe9
Author: Josh Elser <el...@apache.org>
Authored: Fri Jun 29 15:19:59 2018 -0400
Committer: zhangduo <zh...@apache.org>
Committed: Tue Jul 3 10:14:34 2018 +0800

----------------------------------------------------------------------
 .../main/java/org/apache/hadoop/hbase/ipc/RpcServer.java    | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/13e4578b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcServer.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcServer.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcServer.java
index 31f0860..fb2ee40 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcServer.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcServer.java
@@ -496,7 +496,14 @@ public abstract class RpcServer implements RpcServerInterface,
     responseInfo.put("class", server == null? "": server.getClass().getSimpleName());
     responseInfo.put("method", methodName);
     responseInfo.put("call", call);
-    responseInfo.put("param", ProtobufUtil.getShortTextFormat(param));
+    // The params could be really big, make sure they don't kill us at WARN
+    String stringifiedParam = ProtobufUtil.getShortTextFormat(param);
+    if (stringifiedParam.length() > 150) {
+      // Truncate to 1000 chars if TRACE is on, else to 150 chars
+      stringifiedParam = stringifiedParam.subSequence(
+          0, LOG.isTraceEnabled() ? 1000 : 150) + " <TRUNCATED>";
+    }
+    responseInfo.put("param", stringifiedParam);
     if (param instanceof ClientProtos.ScanRequest && rsRpcServices != null) {
       ClientProtos.ScanRequest request = ((ClientProtos.ScanRequest) param);
       if (request.hasScannerId()) {