hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject [9/9] hbase git commit: HBASE-19215 Incorrect exception handling on the client causes incorrect call timeouts and byte buffer allocations on the server
Date Tue, 14 Nov 2017 02:21:44 GMT
HBASE-19215 Incorrect exception handling on the client causes incorrect call timeouts and byte
buffer allocations on the server

Signed-off-by: Andrew Purtell <apurtell@apache.org>
Amending-Author: Andrew Purtell <apurtell@apache.org>

Conflicts:
	hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/BlockingRpcConnection.java


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

Branch: refs/heads/branch-1.3
Commit: 26ff42091cc5f00df7e66db1e41b05868d551c59
Parents: d4acc9b
Author: Abhishek Singh Chouhan <achouhan@apache.org>
Authored: Mon Nov 13 17:16:31 2017 +0530
Committer: Andrew Purtell <apurtell@apache.org>
Committed: Mon Nov 13 18:17:05 2017 -0800

----------------------------------------------------------------------
 .../src/main/java/org/apache/hadoop/hbase/ipc/IPCUtil.java   | 8 ++++++++
 .../main/java/org/apache/hadoop/hbase/ipc/RpcClientImpl.java | 7 +++++--
 2 files changed, 13 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/26ff4209/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/IPCUtil.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/IPCUtil.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/IPCUtil.java
index c238adb..9b2d717 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/IPCUtil.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/IPCUtil.java
@@ -313,4 +313,12 @@ public class IPCUtil {
     Preconditions.checkArgument(totalSize < Integer.MAX_VALUE);
     return totalSize;
   }
+
+  static IOException toIOE(Throwable t) {
+    if (t instanceof IOException) {
+      return (IOException) t;
+    } else {
+      return new IOException(t);
+    }
+  }
 }

http://git-wip-us.apache.org/repos/asf/hbase/blob/26ff4209/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/RpcClientImpl.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/RpcClientImpl.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/RpcClientImpl.java
index bc92c65..3052ab9 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/RpcClientImpl.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/RpcClientImpl.java
@@ -924,11 +924,14 @@ public class RpcClientImpl extends AbstractRpcClient {
         try {
           call.callStats.setRequestSizeBytes(IPCUtil.write(this.out, header, call.param,
               cellBlock));
-        } catch (IOException e) {
+        } catch (Throwable t) {
+          if (LOG.isTraceEnabled()) {
+            LOG.trace("Error while writing call, call_id:" + call.id, t);
+          }
           // We set the value inside the synchronized block, this way the next in line
           //  won't even try to write. Otherwise we might miss a call in the calls map?
           shouldCloseConnection.set(true);
-          writeException = e;
+          writeException = IPCUtil.toIOE(t);
           interrupt();
         }
       }


Mime
View raw message