Browse Source

YARN-621. Changed YARN web app to not add paths that can cause duplicate additions of authenticated filters there by causing kerberos replay errors. Contributed by Omkar Vinit Joshi.
svn merge --ignore-ancestry -c 1529030 ../../trunk/


git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2.1-beta@1529032 13f79535-47bb-0310-9956-ffa450edef68

Vinod Kumar Vavilapalli 11 years ago
parent
commit
a8927247ec

+ 4 - 0
hadoop-yarn-project/CHANGES.txt

@@ -79,6 +79,10 @@ Release 2.1.2 - UNRELEASED
     YARN-890. Ensure CapacityScheduler doesn't round-up metric for available 
     resources. (Xuan Gong & Hitesh Shah via acmurthy)
 
+    YARN-621. Changed YARN web app to not add paths that can cause duplicate
+    additions of authenticated filters there by causing kerberos replay errors.
+    (Omkar Vinit Joshi via vinodkv)
+
 Release 2.1.1-beta - 2013-09-23
 
   INCOMPATIBLE CHANGES

+ 8 - 1
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/webapp/WebApps.java

@@ -23,8 +23,10 @@ import static com.google.common.base.Preconditions.checkNotNull;
 import java.io.IOException;
 import java.net.ConnectException;
 import java.net.URL;
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.HashSet;
+import java.util.List;
 import java.util.Map;
 
 import javax.servlet.http.HttpServlet;
@@ -167,18 +169,23 @@ public class WebApps {
       webapp.setWebServices(wsName);
       String basePath = "/" + name;
       webapp.setRedirectPath(basePath);
+      List<String> pathList = new ArrayList<String>();
       if (basePath.equals("/")) { 
         webapp.addServePathSpec("/*");
+        pathList.add("/*");
       }  else {
         webapp.addServePathSpec(basePath);
         webapp.addServePathSpec(basePath + "/*");
+        pathList.add(basePath + "/*");
       }
       if (wsName != null && !wsName.equals(basePath)) {
         if (wsName.equals("/")) { 
           webapp.addServePathSpec("/*");
+          pathList.add("/*");
         } else {
           webapp.addServePathSpec("/" + wsName);
           webapp.addServePathSpec("/" + wsName + "/*");
+          pathList.add("/" + wsName + "/*");
         }
       }
       if (conf == null) {
@@ -212,7 +219,7 @@ public class WebApps {
         HttpServer server =
             new HttpServer(name, bindAddress, port, findPort, conf,
                 new AdminACLsManager(conf).getAdminAcl(), null,
-                webapp.getServePathSpecs()) {
+                pathList.toArray(new String[0])) {
 
               {
                 if (UserGroupInformation.isSecurityEnabled()) {