hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xg...@apache.org
Subject hadoop git commit: YARN-3582. NPE in WebAppProxyServlet. Contributed by Jian He
Date Wed, 06 May 2015 04:43:13 GMT
Repository: hadoop
Updated Branches:
  refs/heads/trunk 90b384564 -> a583a4069


YARN-3582. NPE in WebAppProxyServlet. Contributed by Jian He


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

Branch: refs/heads/trunk
Commit: a583a40693f5c56c40b39fd12cfa0bb7174fc526
Parents: 90b3845
Author: Xuan <xgong@apache.org>
Authored: Tue May 5 21:42:19 2015 -0700
Committer: Xuan <xgong@apache.org>
Committed: Tue May 5 21:42:19 2015 -0700

----------------------------------------------------------------------
 hadoop-yarn-project/CHANGES.txt                               | 2 ++
 .../hadoop/yarn/server/webproxy/WebAppProxyServlet.java       | 7 +++++--
 .../hadoop/yarn/server/webproxy/TestWebAppProxyServlet.java   | 7 +++++++
 3 files changed, 14 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/a583a406/hadoop-yarn-project/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt
index 00dd205..97b7ee4 100644
--- a/hadoop-yarn-project/CHANGES.txt
+++ b/hadoop-yarn-project/CHANGES.txt
@@ -316,6 +316,8 @@ Release 2.8.0 - UNRELEASED
     YARN-3343. Increased TestCapacitySchedulerNodeLabelUpdate#testNodeUpdate
     timeout. (Rohith Sharmaks via jianhe)
 
+    YARN-3582. NPE in WebAppProxyServlet. (jian he via xgong)
+
 Release 2.7.1 - UNRELEASED
 
   INCOMPATIBLE CHANGES

http://git-wip-us.apache.org/repos/asf/hadoop/blob/a583a406/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-web-proxy/src/main/java/org/apache/hadoop/yarn/server/webproxy/WebAppProxyServlet.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-web-proxy/src/main/java/org/apache/hadoop/yarn/server/webproxy/WebAppProxyServlet.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-web-proxy/src/main/java/org/apache/hadoop/yarn/server/webproxy/WebAppProxyServlet.java
index fd98c80..d45beb6 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-web-proxy/src/main/java/org/apache/hadoop/yarn/server/webproxy/WebAppProxyServlet.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-web-proxy/src/main/java/org/apache/hadoop/yarn/server/webproxy/WebAppProxyServlet.java
@@ -248,8 +248,11 @@ public class WebAppProxyServlet extends HttpServlet {
       final String remoteUser = req.getRemoteUser();
       final String pathInfo = req.getPathInfo();
 
-      String[] parts = pathInfo.split("/", 3);
-      if(parts.length < 2) {
+      String[] parts = null;
+      if (pathInfo != null) {
+        parts = pathInfo.split("/", 3);
+      }
+      if(parts == null || parts.length < 2) {
         LOG.warn("{} gave an invalid proxy path {}", remoteUser,  pathInfo);
         notFound(resp, "Your path appears to be formatted incorrectly.");
         return;

http://git-wip-us.apache.org/repos/asf/hadoop/blob/a583a406/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-web-proxy/src/test/java/org/apache/hadoop/yarn/server/webproxy/TestWebAppProxyServlet.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-web-proxy/src/test/java/org/apache/hadoop/yarn/server/webproxy/TestWebAppProxyServlet.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-web-proxy/src/test/java/org/apache/hadoop/yarn/server/webproxy/TestWebAppProxyServlet.java
index aa6d918..2a2ca2c 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-web-proxy/src/test/java/org/apache/hadoop/yarn/server/webproxy/TestWebAppProxyServlet.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-web-proxy/src/test/java/org/apache/hadoop/yarn/server/webproxy/TestWebAppProxyServlet.java
@@ -131,6 +131,13 @@ public class TestWebAppProxyServlet {
 
     // wrong url
     try {
+      // wrong url without app ID
+      URL emptyUrl = new URL("http://localhost:" + proxyPort + "/proxy");
+      HttpURLConnection emptyProxyConn = (HttpURLConnection) emptyUrl
+          .openConnection();
+      emptyProxyConn.connect();;
+      assertEquals(HttpURLConnection.HTTP_NOT_FOUND, emptyProxyConn.getResponseCode());
+
       // wrong url. Set wrong app ID
       URL wrongUrl = new URL("http://localhost:" + proxyPort + "/proxy/app");
       HttpURLConnection proxyConn = (HttpURLConnection) wrongUrl


Mime
View raw message