Index: src/main/java/org/apache/hadoop/hbase/ipc/HBaseServer.java =================================================================== --- src/main/java/org/apache/hadoop/hbase/ipc/HBaseServer.java (revision 1415992) +++ src/main/java/org/apache/hadoop/hbase/ipc/HBaseServer.java (working copy) @@ -286,6 +286,11 @@ protected long size; // size of current call protected boolean isError; + /*Change it to false to avoid client disconnect but + *server still processing + */ + protected boolean isClientExists = true; + public Call(int id, Writable param, Connection connection, Responder responder, long size) { this.id = id; @@ -299,6 +304,10 @@ this.size = size; } + public boolean getClientState(){ + return isClientExists; + } + @Override public String toString() { return param.toString() + " from " + connection.toString(); @@ -432,6 +441,9 @@ @Override public void throwExceptionIfCallerDisconnected() throws CallerDisconnectedException { if (!connection.channel.isOpen()) { + //Client disappeared + isClientExists = false; + long afterTime = System.currentTimeMillis() - timestamp; throw new CallerDisconnectedException( "Aborting call " + this + " after " + afterTime + " ms, since " + @@ -1854,4 +1866,10 @@ public long getResponseQueueSize(){ return responseQueuesSizeThrottler.getCurrentValue(); } + + public static boolean getCurCallClientState(){ + Call call = CurCall.get(); + return null == call ? true : call.getClientState(); + } + } Index: src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java =================================================================== --- src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java (revision 1415992) +++ src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java (working copy) @@ -111,6 +111,7 @@ import org.apache.hadoop.hbase.io.hfile.BlockCacheColumnFamilySummary; import org.apache.hadoop.hbase.io.hfile.CacheConfig; import org.apache.hadoop.hbase.io.hfile.CacheStats; +import org.apache.hadoop.hbase.ipc.CallerDisconnectedException; import org.apache.hadoop.hbase.ipc.CoprocessorProtocol; import org.apache.hadoop.hbase.ipc.HBaseRPC; import org.apache.hadoop.hbase.ipc.HBaseRPCErrorHandler; @@ -3434,6 +3435,14 @@ if (action instanceof Delete || action instanceof Put) { mutations.add(a); } else if (action instanceof Get) { + boolean isClientExists = HBaseServer.getCurCallClientState(); + if (!isClientExists){ + response.add(regionName, originalIndex, + new CallerDisconnectedException("Aborting call because client disconnect.")); + + //Server stop processing here, because client disappear. + return response; + } response.add(regionName, originalIndex, get(regionName, (Get)action)); } else if (action instanceof Exec) {