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

Junping Du commented on YARN-2242:
----------------------------------

+1 on using StringBuilder instead of String given many joint operation here. In 
this direction, we should do more like replace "+" to StringBuilder .append()
{code}
+    diagnosticsBuilder.append("AM Container for "
+        + finishEvent.getApplicationAttemptId()
+        + " exited with " + " exitCode: " + status.getExitStatus() + "\n");
{code}
For unit test code:
{code}
-    
verifyAMCrashAtAllocatedDiagnosticInfo(applicationAttempt.getDiagnostics());
+    if (applicationAttempt.getTrackingUrl() != null) {
+      
verifyAMCrashAtAllocatedDiagnosticInfo(applicationAttempt.getDiagnostics());
+    }
{code}
If trackingUrl here is possible to be null for this unit test, then I would 
suggest to pass a boolean to verifyAMCrashAtAllocatedDiagnosticInfo to see if 
need to verify TrackingURL. Also within 
verifyAMCrashAtAllocatedDiagnosticInfo(), we should verify if the diagnostic 
info include appAttemptId and exitCode.

> 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
>
>
> 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
(v6.2#6252)

Reply via email to