You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@mesos.apache.org by "Timothy Chen (JIRA)" <ji...@apache.org> on 2014/08/03 09:22:11 UTC

[jira] [Comment Edited] (MESOS-1652) Stream Docker logs into sandbox logs

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

Timothy Chen edited comment on MESOS-1652 at 8/3/14 7:20 AM:
-------------------------------------------------------------

[~jieyu] we talked about removing the detach and just attach stdout and stderr as part of docker run to collect its stdout and stderr logs into the sandbox. I just tried doing so and found out the problem arises is that I don't know if my docker container succeeded to launch or not since I can't wait on the status future of the subprocess anymore. As our current approach launches the docker run, then launches a command executor with a docker wait that waits on the container, without detach we can run into a race when the docker run hasn't yet launched the container but we already attempt to run docker wait and failed to find it. There need to be a way to distinguish between docker failed to launch the container or the docker run command itself failed, also the solve the docker wait.
I was thinking one way is to put this into a specific executor (docker executor) that just runs docker run synchronously, and when the status returns check to see if docker ps has that container to see if it was a failed launch or a failed container, so to move away from docker wait completely. 
I'm not sure if this is all worth just for attaching stdout and stderr though.

Not sure if you or [~benjaminhindman] has any thoughts or better approaches here? 


was (Author: tnachen):
[~jieyu] we talked about removing the detach and just attach stdout and stderr as part of docker run to collect its stdout and stderr logs into the sandbox. I just tried doing so and found out the problem arises is that I don't know if my docker container succeeded to launch or not since I can't wait on the status future of the subprocess anymore. As our current approach launches the docker run, then launches a command executor with a docker wait that waits on the container, without detach we can run into a race when the docker run hasn't yet launched the container but we already attempt to run docker wait and failed to find it. I don't know is there any good way to know if we distinguish between docker failed to launch the container or the docker run command itself failed.

Not sure if you or [~benjaminhindman] has any good approaches here? If we don't have a good answer we might need to failback to the original -d and stream both stderr and stdout into a log file.

> Stream Docker logs into sandbox logs
> ------------------------------------
>
>                 Key: MESOS-1652
>                 URL: https://issues.apache.org/jira/browse/MESOS-1652
>             Project: Mesos
>          Issue Type: Improvement
>            Reporter: Timothy Chen
>            Assignee: Timothy Chen
>
> We should write logs either during or after the task launched the logs from the docker container into the sandbox so it can be viewed without actually going to the host and calling "docker logs".



--
This message was sent by Atlassian JIRA
(v6.2#6252)