You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by br...@apache.org on 2008/03/15 22:28:01 UTC

svn commit: r637479 - in /hadoop/hbase/branches/0.1: CHANGES.txt src/java/org/apache/hadoop/hbase/HTable.java

Author: bryanduxbury
Date: Sat Mar 15 14:27:49 2008
New Revision: 637479

URL: http://svn.apache.org/viewvc?rev=637479&view=rev
Log:
HBASE-506 When an exception has to escape ServerCallable due to exhausted retries, show all the exceptions that lead to this situation
-Updated ServerCallable to track a list of exceptions and report them all when the process runs out of retries

Modified:
    hadoop/hbase/branches/0.1/CHANGES.txt
    hadoop/hbase/branches/0.1/src/java/org/apache/hadoop/hbase/HTable.java

Modified: hadoop/hbase/branches/0.1/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.1/CHANGES.txt?rev=637479&r1=637478&r2=637479&view=diff
==============================================================================
--- hadoop/hbase/branches/0.1/CHANGES.txt (original)
+++ hadoop/hbase/branches/0.1/CHANGES.txt Sat Mar 15 14:27:49 2008
@@ -13,6 +13,8 @@
                with a hbase from 0.16.0
 
   NEW FEATURES
+   HBASE-506   When an exception has to escape ServerCallable due to exhausted retries, 
+               show all the exceptions that lead to this situation
 
   OPTIMIZATIONS
 

Modified: hadoop/hbase/branches/0.1/src/java/org/apache/hadoop/hbase/HTable.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.1/src/java/org/apache/hadoop/hbase/HTable.java?rev=637479&r1=637478&r2=637479&view=diff
==============================================================================
--- hadoop/hbase/branches/0.1/src/java/org/apache/hadoop/hbase/HTable.java (original)
+++ hadoop/hbase/branches/0.1/src/java/org/apache/hadoop/hbase/HTable.java Sat Mar 15 14:27:49 2008
@@ -1018,6 +1018,7 @@
    */
   protected <T> T getRegionServerWithRetries(ServerCallable<T> callable) 
   throws IOException, RuntimeException {
+    List<IOException> exceptions = new ArrayList<IOException>();
     for(int tries = 0; tries < numRetries; tries++) {
       try {
         callable.instantiateServer(tries != 0);
@@ -1027,11 +1028,24 @@
           e = RemoteExceptionHandler.decodeRemoteException((RemoteException) e);
         }
         if (tries == numRetries - 1) {
+          if (LOG.isDebugEnabled()) {
+            String message = "Trying to contact region server for row '" + 
+              callable.row + "', but failed after " + (tries + 1)  + 
+              " attempts.\n";
+            int i = 1;
+            for (IOException e2 : exceptions) {
+              message = message + "Exception " + i + ":\n" + e;
+            }
+            LOG.debug(message);
+          }
           throw e;
+        } else {
+          if (LOG.isDebugEnabled()) {
+            exceptions.add(e);
+            LOG.debug("reloading table servers because: " + e.getMessage());
+          }
         }
-        if (LOG.isDebugEnabled()) {
-          LOG.debug("reloading table servers because: " + e.getMessage());
-        }
+
       } catch (Exception e) {
         throw new RuntimeException(e);
       }