You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2012/03/08 05:59:33 UTC

svn commit: r1298271 - /hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/ipc/HBaseClient.java

Author: stack
Date: Thu Mar  8 04:59:32 2012
New Revision: 1298271

URL: http://svn.apache.org/viewvc?rev=1298271&view=rev
Log:
HBASE-4890 fix possible NPE in HConnectionManager

Modified:
    hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/ipc/HBaseClient.java

Modified: hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/ipc/HBaseClient.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/ipc/HBaseClient.java?rev=1298271&r1=1298270&r2=1298271&view=diff
==============================================================================
--- hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/ipc/HBaseClient.java (original)
+++ hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/ipc/HBaseClient.java Thu Mar  8 04:59:32 2012
@@ -674,7 +674,17 @@ public class HBaseClient {
         Call c = itor.next().getValue();
         long waitTime = System.currentTimeMillis() - c.getStartTime();
         if (waitTime >= rpcTimeout) {
-          c.setException(closeException); // local exception
+          if (this.closeException == null) {
+            // There may be no exception in the case that there are many calls
+            // being multiplexed over this connection and these are succeeding
+            // fine while this Call object is taking a long time to finish
+            // over on the server; e.g. I just asked the regionserver to bulk
+            // open 3k regions or its a big fat multiput into a heavily-loaded
+            // server (Perhaps this only happens at the extremes?)
+            this.closeException = new CallTimeoutException("Call id=" + c.id +
+              ", waitTime=" + waitTime + ", rpcTimetout=" + rpcTimeout);
+          }
+          c.setException(this.closeException);
           synchronized (c) {
             c.notifyAll();
           }
@@ -703,6 +713,15 @@ public class HBaseClient {
     }
   }
 
+  /**
+   * Client-side call timeout
+   */
+  public static class CallTimeoutException extends IOException {
+    public CallTimeoutException(final String msg) {
+      super(msg);
+    }
+  }
+
   /** Call implementation used for parallel calls. */
   protected class ParallelCall extends Call {
     private final ParallelResults results;