From 7b387f55c3f30c32e3fe672268d6d4ae6c120f70 Mon Sep 17 00:00:00 2001 From: Robert Joseph Evans Date: Tue, 3 Apr 2012 19:37:46 +0000 Subject: [PATCH] MAPREDUCE-3999. Tracking link gives an error if the AppMaster hasn't started yet (Ravi Prakash via bobby) git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1309108 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-mapreduce-project/CHANGES.txt | 3 +++ .../server/webproxy/WebAppProxyServlet.java | 21 +++++++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index 0d2e88773c..46ad6ec0e8 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -234,6 +234,9 @@ Release 0.23.3 - UNRELEASED MAPREDUCE-3988. mapreduce.job.local.dir doesn't point to a single directory on a node. (Eric Payne via bobby) + MAPREDUCE-3999. Tracking link gives an error if the AppMaster hasn't + started yet (Ravi Prakash via bobby) + Release 0.23.2 - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-web-proxy/src/main/java/org/apache/hadoop/yarn/server/webproxy/WebAppProxyServlet.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-web-proxy/src/main/java/org/apache/hadoop/yarn/server/webproxy/WebAppProxyServlet.java index 657b466c29..93f6d0d252 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-web-proxy/src/main/java/org/apache/hadoop/yarn/server/webproxy/WebAppProxyServlet.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-web-proxy/src/main/java/org/apache/hadoop/yarn/server/webproxy/WebAppProxyServlet.java @@ -37,9 +37,9 @@ import javax.servlet.http.HttpServletResponse; import org.apache.commons.httpclient.Header; +import org.apache.commons.httpclient.HostConfiguration; import org.apache.commons.httpclient.HttpClient; import org.apache.commons.httpclient.HttpMethod; -import org.apache.commons.httpclient.HostConfiguration; import org.apache.commons.httpclient.cookie.CookiePolicy; import org.apache.commons.httpclient.methods.GetMethod; import org.apache.commons.httpclient.params.HttpClientParams; @@ -260,7 +260,24 @@ protected void doGet(HttpServletRequest req, HttpServletResponse resp) URI trackingUri = ProxyUriUtils.getUriFromAMUrl( applicationReport.getOriginalTrackingUrl()); if(applicationReport.getOriginalTrackingUrl().equals("N/A")) { - notFound(resp, "The MRAppMaster died before writing anything."); + String message; + switch(applicationReport.getFinalApplicationStatus()) { + case FAILED: + case KILLED: + case SUCCEEDED: + message = + "The requested application exited before setting a tracking URL."; + break; + case UNDEFINED: + message = "The requested application does not appear to be running " + +"yet, and has not set a tracking URL."; + break; + default: + //This should never happen, but just to be safe + message = "The requested application has not set a tracking URL."; + break; + } + notFound(resp, message); return; }