[ 
https://issues.apache.org/jira/browse/YARN-3967?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14640769#comment-14640769
 ] 

Jason Lowe commented on YARN-3967:
----------------------------------

I'm confused why we are not simply adding a separate explicit clause to catch 
ApplicationNotFoundException instead of YarnException.  Seems like it should 
just be:
{code}
    try {
      response = applicationsManager.getApplicationReport(request);
    } catch (ApplicationNotFoundException e) {
      if (!isAHSEnabled) {
        // Just throw it as usual if historyService is not enabled.
        throw e;
      }
      response = historyManager.getApplicationReport(request);
    }
{code}

This code also needs to be updated to handle the case when the appreport 
doesn't have a tracking URL and we got the report from the history server, as 
we will direct the user to the RM app page.  We already know the RM app page 
doesn't exist due to the ApplicationNotFoundException earlier:
{code}
      // fallback to ResourceManager's app page if no tracking URI provided
      if(original == null || original.equals("N/A")) {
        resp.sendRedirect(resp.encodeRedirectURL(
            StringHelper.pjoin(rmAppPageUrlBase, id.toString())));
        return;
      } else {
        if (ProxyUriUtils.getSchemeFromUrl(original).isEmpty()) {
          trackingUri = ProxyUriUtils.getUriFromAMUrl(
              WebAppUtils.getHttpSchemePrefix(conf), original);
        } else {
          trackingUri = new URI(original);
        }
      }
{code}


> Fetch the application report from the AHS if the RM does not know about it
> --------------------------------------------------------------------------
>
>                 Key: YARN-3967
>                 URL: https://issues.apache.org/jira/browse/YARN-3967
>             Project: Hadoop YARN
>          Issue Type: Bug
>    Affects Versions: 2.7.1
>            Reporter: Mit Desai
>            Assignee: Mit Desai
>             Fix For: 2.7.2
>
>         Attachments: YARN-3967.1.patch, YARN-3967.2.patch, YARN-3967.3.patch
>
>
> If the application history service has been enabled and RM has forgotten 
> anout an application, try and fetch the app report form the AHS.
> On larger clusters, the RM can forget about the applications in about 30 
> minutes. The proxy url generated during the job submission will try to fetch 
> the app report from the RM and will fail to get anything from there. If the 
> app is not found in the RM, we will need to get the application report from 
> the Application History Server  (if it is enabled) to see if we can get any 
> information on that application before throwing an exception.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to