Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 19066200D61 for ; Tue, 14 Nov 2017 03:21:39 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 17A9F160BF3; Tue, 14 Nov 2017 02:21:39 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 69B13160C06 for ; Tue, 14 Nov 2017 03:21:38 +0100 (CET) Received: (qmail 84559 invoked by uid 500); 14 Nov 2017 02:21:37 -0000 Mailing-List: contact commits-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list commits@hbase.apache.org Received: (qmail 84243 invoked by uid 99); 14 Nov 2017 02:21:37 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Nov 2017 02:21:37 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 66210F4F66; Tue, 14 Nov 2017 02:21:36 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: apurtell@apache.org To: commits@hbase.apache.org Date: Tue, 14 Nov 2017 02:21:44 -0000 Message-Id: <5341f734134c4d76a89564ba29204d19@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer 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 archived-at: Tue, 14 Nov 2017 02:21:39 -0000 HBASE-19215 Incorrect exception handling on the client causes incorrect call timeouts and byte buffer allocations on the server Signed-off-by: Andrew Purtell Amending-Author: Andrew Purtell 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 Authored: Mon Nov 13 17:16:31 2017 +0530 Committer: Andrew Purtell 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(); } }