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.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1529030 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Vinod Kumar Vavilapalli 2013-10-03 23:21:32 +00:00
parent 79a11ce09d
commit 1608d8b527
2 changed files with 12 additions and 1 deletions

View File

@ -137,6 +137,10 @@ Release 2.1.2 - UNRELEASED
YARN-890. Ensure CapacityScheduler doesn't round-up metric for available YARN-890. Ensure CapacityScheduler doesn't round-up metric for available
resources. (Xuan Gong & Hitesh Shah via acmurthy) 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 Release 2.1.1-beta - 2013-09-23
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

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