You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by li...@apache.org on 2012/11/21 01:01:59 UTC

svn commit: r1411939 - /hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/client/RetriesExhaustedException.java

Author: liyin
Date: Wed Nov 21 00:01:59 2012
New Revision: 1411939

URL: http://svn.apache.org/viewvc?rev=1411939&view=rev
Log:
[HBASE-7193] Print the detail exceptions info from the RetriesExhaustedException

Author: liyintang

Summary:
The hbase client only prints the name of exception for the RetriesExhaustedException logging purpose, which failed to provide any useful debug information.

So this diff is to enhance the logging to print the entire stack track of the exception to help on issue investigation.

Test Plan: Tested by a simple java unit test.

Reviewers: kannan

Reviewed By: kannan

CC: hbase-eng@, anshumansingh26

Differential Revision: https://phabricator.fb.com/D634343

Modified:
    hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/client/RetriesExhaustedException.java

Modified: hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/client/RetriesExhaustedException.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/client/RetriesExhaustedException.java?rev=1411939&r1=1411938&r2=1411939&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/client/RetriesExhaustedException.java (original)
+++ hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/client/RetriesExhaustedException.java Wed Nov 21 00:01:59 2012
@@ -18,6 +18,8 @@ package org.apache.hadoop.hbase.client;
 import org.apache.hadoop.hbase.util.Bytes;
 
 import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.StringWriter;
 import java.util.List;
 
 /**
@@ -58,7 +60,15 @@ public class RetriesExhaustedException e
     buffer.append(" attempts.\nExceptions:\n");
     for (Throwable t : exceptions) {
       buffer.append(t.toString());
+      
+      StringWriter errors = new StringWriter();
+      t.printStackTrace(new PrintWriter(errors));
+      buffer.append(errors.toString());
       buffer.append("\n");
+      
+      try { 
+        errors.close();
+      } catch (IOException e) {} // ignore
     }
     return buffer.toString();
   }