From c14dd4f5153caaa4c2ed9d45c3573a279bae553e Mon Sep 17 00:00:00 2001 From: liangxie Date: Thu, 13 Feb 2014 03:44:44 +0000 Subject: [PATCH] HBASE-10506 Fail-fast if client connection is lost before the real call be executed in RPC layer git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1567841 13f79535-47bb-0310-9956-ffa450edef68 --- .../main/java/org/apache/hadoop/hbase/ipc/CallRunner.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/CallRunner.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/CallRunner.java index 03c0e14f3fb..31484bb5fb4 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/CallRunner.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/CallRunner.java @@ -67,6 +67,12 @@ public class CallRunner { public void run() { try { + if (!call.connection.channel.isOpen()) { + if (RpcServer.LOG.isDebugEnabled()) { + RpcServer.LOG.debug(Thread.currentThread().getName() + ": skipped " + call); + } + return; + } this.status.setStatus("Setting up call"); this.status.setConnection(call.connection.getHostAddress(), call.connection.getRemotePort()); if (RpcServer.LOG.isDebugEnabled()) { @@ -147,4 +153,4 @@ public class CallRunner { RpcServer.MONITORED_RPC.set(status); return status; } -} \ No newline at end of file +}