diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index a90be244384..009e042ba9f 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -88,6 +88,8 @@ Trunk (unreleased changes) MAPREDUCE-2764. Fix renewal of dfs delegation tokens. (Owen via jitendra) + HADOOP-7769. TestJMXJsonServlet is failing. (tomwhite) + Release 0.23.0 - Unreleased INCOMPATIBLE CHANGES diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/jmx/JMXJsonServlet.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/jmx/JMXJsonServlet.java index c886d0043ba..f4f26acb2d6 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/jmx/JMXJsonServlet.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/jmx/JMXJsonServlet.java @@ -168,6 +168,7 @@ public class JMXJsonServlet extends HttpServlet { if (splitStrings.length != 2) { jg.writeStringField("result", "ERROR"); jg.writeStringField("message", "query format is not as expected."); + jg.flush(); response.setStatus(HttpServletResponse.SC_BAD_REQUEST); return; } diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/jmx/TestJMXJsonServlet.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/jmx/TestJMXJsonServlet.java index 62a2af95552..ea2f76bf10a 100644 --- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/jmx/TestJMXJsonServlet.java +++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/jmx/TestJMXJsonServlet.java @@ -51,7 +51,7 @@ public class TestJMXJsonServlet extends HttpServerFunctionalTest { assertTrue("'"+p+"' does not match "+value, m.find()); } - @Test public void testQury() throws Exception { + @Test public void testQuery() throws Exception { String result = readOutput(new URL(baseUrl, "/jmx?qry=java.lang:type=Runtime")); LOG.info("/jmx?qry=java.lang:type=Runtime RESULT: "+result); assertReFind("\"name\"\\s*:\\s*\"java.lang:type=Runtime\"", result);