YARN-3526. ApplicationMaster tracking URL is incorrectly redirected on a QJM cluster. Contributed by Weiwei Yang

This commit is contained in:
Xuan 2015-05-15 22:39:49 -07:00
parent ac742c762d
commit b0ad644083
3 changed files with 8 additions and 0 deletions

View File

@ -503,6 +503,9 @@ Release 2.7.1 - UNRELEASED
YARN-3641. NodeManager: stopRecoveryStore() shouldn't be skipped when
exceptions happen in stopping NM's sub-services. (Junping Du via jlowe)
YARN-3526. ApplicationMaster tracking URL is incorrectly redirected
on a QJM cluster. (Weiwei Yang via xgong)
Release 2.7.0 - 2015-04-20
INCOMPATIBLE CHANGES

View File

@ -326,6 +326,9 @@ public void testRMWebAppRedirect() throws YarnException,
header = getHeader("Refresh", rm2Url + "/ws/v1/cluster/apps");
assertTrue(header.contains("; url=" + rm1Url));
header = getHeader("Refresh", rm2Url + "/proxy/" + fakeAppId);
assertEquals(null, header);
// Due to the limitation of MiniYARNCluster and dispatcher is a singleton,
// we couldn't add the test case after explicitFailover();
}

View File

@ -30,6 +30,7 @@
import javax.servlet.http.HttpServletResponse;
import org.apache.hadoop.http.HtmlQuoting;
import org.apache.hadoop.yarn.server.webproxy.ProxyUriUtils;
import com.google.common.collect.Sets;
import com.google.inject.Injector;
@ -88,6 +89,7 @@ && shouldRedirect(rmWebApp, uri)) {
private boolean shouldRedirect(RMWebApp rmWebApp, String uri) {
return !uri.equals("/" + rmWebApp.wsName() + "/v1/cluster/info")
&& !uri.equals("/" + rmWebApp.name() + "/cluster")
&& !uri.startsWith(ProxyUriUtils.PROXY_BASE)
&& !NON_REDIRECTED_URIS.contains(uri);
}
}