hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject hbase git commit: HBASE-13555 StackServlet produces 500 error
Date Fri, 24 Apr 2015 23:39:48 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1.1 20ddb622c -> 0fdd93f32


HBASE-13555 StackServlet produces 500 error


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/0fdd93f3
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/0fdd93f3
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/0fdd93f3

Branch: refs/heads/branch-1.1
Commit: 0fdd93f32b395f9dd5acac0faf3069102c0474d3
Parents: 20ddb62
Author: tedyu <yuzhihong@gmail.com>
Authored: Fri Apr 24 16:39:05 2015 -0700
Committer: tedyu <yuzhihong@gmail.com>
Committed: Fri Apr 24 16:39:05 2015 -0700

----------------------------------------------------------------------
 .../apache/hadoop/hbase/http/HttpServer.java    | 11 +++++-----
 .../hbase/regionserver/RSDumpServlet.java       | 22 ++++++++++++--------
 2 files changed, 18 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/0fdd93f3/hbase-server/src/main/java/org/apache/hadoop/hbase/http/HttpServer.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/http/HttpServer.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/http/HttpServer.java
index c0bf6f9..1ffd515 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/http/HttpServer.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/http/HttpServer.java
@@ -21,7 +21,6 @@ import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.InterruptedIOException;
 import java.io.PrintStream;
-import java.io.PrintWriter;
 import java.net.BindException;
 import java.net.InetSocketAddress;
 import java.net.URI;
@@ -1213,11 +1212,11 @@ public class HttpServer implements FilterContainer {
         return;
       }
       response.setContentType("text/plain; charset=UTF-8");
-      PrintWriter out = response.getWriter();
-      PrintStream ps = new PrintStream(response.getOutputStream(), false, "UTF-8");
-      Threads.printThreadInfo(ps, "");
-      ps.flush();
-      out.close();
+      try (PrintStream out = new PrintStream(
+        response.getOutputStream(), false, "UTF-8")) {
+        Threads.printThreadInfo(out, "");
+        out.flush();
+      }
       ReflectionUtils.logThreadInfo(LOG, "jsp requested", 1);
     }
   }

http://git-wip-us.apache.org/repos/asf/hbase/blob/0fdd93f3/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSDumpServlet.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSDumpServlet.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSDumpServlet.java
index a38ad0e..77b68ec 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSDumpServlet.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSDumpServlet.java
@@ -102,14 +102,18 @@ public class RSDumpServlet extends StateDumpServlet {
 
   public static void dumpQueue(HRegionServer hrs, PrintWriter out)
       throws IOException {
-    // 1. Print out Compaction/Split Queue
-    out.println("Compaction/Split Queue summary: "
-        + hrs.compactSplitThread.toString() );
-    out.println(hrs.compactSplitThread.dumpQueue());
-
-    // 2. Print out flush Queue
-    out.println("\nFlush Queue summary: "
-        + hrs.cacheFlusher.toString());
-    out.println(hrs.cacheFlusher.dumpQueue());
+    if (hrs.compactSplitThread != null) {
+      // 1. Print out Compaction/Split Queue
+      out.println("Compaction/Split Queue summary: "
+          + hrs.compactSplitThread.toString() );
+      out.println(hrs.compactSplitThread.dumpQueue());
+    }
+
+    if (hrs.cacheFlusher != null) {
+      // 2. Print out flush Queue
+      out.println("\nFlush Queue summary: "
+          + hrs.cacheFlusher.toString());
+      out.println(hrs.cacheFlusher.dumpQueue());
+    }
   }
 }


Mime
View raw message