Junping Du commented on YARN-2242:

[~gtCarrera9], thanks for delivering an update here. The patch get closer.
A little logical mistake here:
+    Boolean shouldCheckURL = (null == applicationAttempt.getTrackingUrl());
should be:
boolean shouldCheckURL = (applicationAttempt.getTrackingUrl() != null);
In addition, we usually use boolean instead of Boolean (the object for boolean) 
to save cost of box (except we need to put boolean value to some object 
container, like List).

For my 1st comments above, I mean to replace StringBuilder.append(string1 + 
string2 +...) with StringBuilder.append(string1).append(string2)... to save the 
cost on joint of string given we already have StringBuilder here: 
    diagnosticsBuilder.append("AM Container for "
        + finishEvent.getApplicationAttemptId()
        + " exited with " + " exitCode: " + status.getExitStatus() + "\n");
    if (this.getTrackingUrl() != null) {
      diagnosticsBuilder.append("For more detailed output,"
        + " check application tracking page:\n" + this.getTrackingUrl() + "\n"
        + "Then, click on links to logs of each attempt.\n");
    diagnosticsBuilder.append("\nDiagnostics: " + status.getDiagnostics()
        + "Failing this attempt");
can be updated to following code (with removing unnecessary \n):
    diagnosticsBuilder.append("AM Container for ").append(
        " exited with ").append(" exitCode: ").append(status.getExitStatus()).
    if (this.getTrackingUrl() != null) {
      diagnosticsBuilder.append("For more detailed output,").append(
        " check application tracking page:").append(
        "Then, click on links to logs of each attempt.\n");
    diagnosticsBuilder.append("Diagnostics: ").append(status.getDiagnostics())
        .append("Failing this attempt");

> Improve exception information on AM launch crashes
> --------------------------------------------------
>                 Key: YARN-2242
>                 URL: https://issues.apache.org/jira/browse/YARN-2242
>             Project: Hadoop YARN
>          Issue Type: Sub-task
>            Reporter: Li Lu
>            Assignee: Li Lu
>             Fix For: 2.6.0
>         Attachments: YARN-2242-070115-2.patch, YARN-2242-070814-1.patch, 
> YARN-2242-070814.patch, YARN-2242-071114.patch
> Now on each time AM Container crashes during launch, both the console and the 
> webpage UI only report a ShellExitCodeExecption. This is not only unhelpful, 
> but sometimes confusing. With the help of log aggregator, container logs are 
> actually aggregated, and can be very helpful for debugging. One possible way 
> to improve the whole process is to send a "pointer" to the aggregated logs to 
> the programmer when reporting exception information. 

This message was sent by Atlassian JIRA

Reply via email to