Browse Source

YARN-236. RM should point tracking URL to RM web page when app fails to start (Jason Lowe via jeagles)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1448406 13f79535-47bb-0310-9956-ffa450edef68
Jonathan Turner Eagles 12 years ago
parent
commit
320f7bdcb8

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

@@ -316,6 +316,9 @@ Release 0.23.7 - UNRELEASED
     YARN-249. Capacity Scheduler web page should show list of active users per 
     YARN-249. Capacity Scheduler web page should show list of active users per 
     queue like it used to (in 1.x) (Ravi Prakash via tgraves)
     queue like it used to (in 1.x) (Ravi Prakash via tgraves)
 
 
+    YARN-236. RM should point tracking URL to RM web page when app fails to
+    start (Jason Lowe via jeagles)
+
   OPTIMIZATIONS
   OPTIMIZATIONS
 
 
     YARN-357. App submission should not be synchronized (daryn)
     YARN-357. App submission should not be synchronized (daryn)

+ 6 - 18
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-web-proxy/src/main/java/org/apache/hadoop/yarn/server/webproxy/WebAppProxyServlet.java

@@ -66,6 +66,7 @@ public class WebAppProxyServlet extends HttpServlet {
   public static final String PROXY_USER_COOKIE_NAME = "proxy-user";
   public static final String PROXY_USER_COOKIE_NAME = "proxy-user";
 
 
   private final List<TrackingUriPlugin> trackingUriPlugins;
   private final List<TrackingUriPlugin> trackingUriPlugins;
+  private final String rmAppPageUrlBase;
 
 
   private static class _ implements Hamlet._ {
   private static class _ implements Hamlet._ {
     //Empty
     //Empty
@@ -91,6 +92,8 @@ public class WebAppProxyServlet extends HttpServlet {
     this.trackingUriPlugins =
     this.trackingUriPlugins =
         conf.getInstances(YarnConfiguration.YARN_TRACKING_URL_GENERATOR,
         conf.getInstances(YarnConfiguration.YARN_TRACKING_URL_GENERATOR,
             TrackingUriPlugin.class);
             TrackingUriPlugin.class);
+    this.rmAppPageUrlBase = StringHelper.pjoin(
+        YarnConfiguration.getRMWebAppURL(conf), "cluster", "app");
   }
   }
 
 
   /**
   /**
@@ -291,25 +294,10 @@ public class WebAppProxyServlet extends HttpServlet {
       if (original != null) {
       if (original != null) {
         trackingUri = ProxyUriUtils.getUriFromAMUrl(original);
         trackingUri = ProxyUriUtils.getUriFromAMUrl(original);
       }
       }
+      // fallback to ResourceManager's app page if no tracking URI provided
       if(original == null || original.equals("N/A")) {
       if(original == null || original.equals("N/A")) {
-        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);
+        resp.sendRedirect(resp.encodeRedirectURL(
+            StringHelper.pjoin(rmAppPageUrlBase, id.toString())));
         return;
         return;
       }
       }