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

Sidharta Seethana commented on YARN-4004:
-----------------------------------------

For the segment of code below, would it be safer to print out the last few 
lines (few = some pre-determined constant) instead of the entire docker logs 
output? Given the duration of the time between 'docker run' and 'docker wait', 
this output is unlikely to be large, but just in case.  Docker has a mechanism 
for this : {{docker logs --tail=<num> <container_id>}}

{code}
 snprintf(docker_logs_command, PATH_MAX, "%s logs %s",
        docker_binary, container_id);
      FILE* logs = popen(docker_logs_command, "r");
      while(fgets(buffer, PATH_MAX, logs) != NULL) {
        fprintf(ERRORFILE, "%s", buffer);
        fflush(ERRORFILE);
      }
{code}





> container-executor should print output of docker logs if the docker container 
> exits with non-0 exit status
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: YARN-4004
>                 URL: https://issues.apache.org/jira/browse/YARN-4004
>             Project: Hadoop YARN
>          Issue Type: Sub-task
>          Components: nodemanager
>    Affects Versions: 2.8.0
>            Reporter: Varun Vasudev
>            Assignee: Varun Vasudev
>         Attachments: YARN-4004.001.patch
>
>
> When a docker container exits with a non-0 exit code, we should print the 
> docker logs to make debugging easier.



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

Reply via email to