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

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

[~vvasudev] ,

I see that the read implementation for docker logs has been changed to read the 
entire output into a single buffer. While this is fine, the size of the buffer 
( `PATH_MAX` ) could be problematic. Would it be better to use a different 
buffer with a different size (which is not tied to paths/PATH_MAX) for this 
purpose? The use of PATH_MAX here makes it a bit confusing.

{code}
  FILE* logs = popen(docker_logs_command, "r");
      if(logs != NULL) {
        clearerr(logs);
        res = fread(buffer, PATH_MAX, 1, logs);
        if(res < 1) {
          fprintf(ERRORFILE, "%s %d %d\n",
            "Unable to read from docker logs(ferror, feof):", ferror(logs), 
feof(logs));
          fflush(ERRORFILE);
        }
        else {
          fprintf(ERRORFILE, "%s\n", 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, YARN-4004.002.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