hadoop-yarn-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chandni Singh (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (YARN-8706) DelayedProcessKiller is executed for Docker containers even though docker stop sends a KILL signal after the specified grace period
Date Fri, 31 Aug 2018 16:32:00 GMT

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

Chandni Singh commented on YARN-8706:

Thanks for the review [~ebadger]
{quote}Both reapContainer() and handleContainerStop() call executeDockerInspect(). Since this
spawns up a new container-executor process every time to do the inspect, it would be nice
if we didn't have to make the call twice.
In {{DockerLinuxContainerRuntime}}, {{reapContainer()}} calls {{handleContainerRemove()}}
which uses docker inspect to just get the status. I don't think it is executing docker inspect
multiple times.

{{handleContainerStop()}} is only called from {{signalContainer()}}.
{quote}Are the changes in DockerCommandExecutor necessary? They look like code refactoring
that isn't relevant to this specific patch.
Yes, I execute docker inspect to get the status and stopsignal together in container stop.
So now I have the status as a {{string}} which I need to convert to {{DockerContainerStatus}}.
The refactoring was necessary in order to avoid duplication of the code.
{quote}Instead, we can follow the code in handleContainerKill() and send the signal directly.
I think this code could probably be combined, since at this point handleContainerKill() and
handleContainerStop() will be doing the same thing.
Ok. I will change this.

> DelayedProcessKiller is executed for Docker containers even though docker stop sends
a KILL signal after the specified grace period
> -----------------------------------------------------------------------------------------------------------------------------------
>                 Key: YARN-8706
>                 URL: https://issues.apache.org/jira/browse/YARN-8706
>             Project: Hadoop YARN
>          Issue Type: Sub-task
>            Reporter: Chandni Singh
>            Assignee: Chandni Singh
>            Priority: Major
>              Labels: docker
>         Attachments: YARN-8706.001.patch
> {{DockerStopCommand}} adds a grace period of 10 seconds.
> 10 seconds is also the default grace time use by docker stop
>  [https://docs.docker.com/engine/reference/commandline/stop/]
> Documentation of the docker stop:
> {quote}the main process inside the container will receive {{SIGTERM}}, and after a grace
period, {{SIGKILL}}.
> {quote}
> There is a {{DelayedProcessKiller}} in {{ContainerExcecutor}} which executes for all
containers after a delay when {{sleepDelayBeforeSigKill>0}}. By default this is set to
{{250 milliseconds}} and so irrespective of the container type, it will always get executed.
> For a docker container, {{docker stop}} takes care of sending a {{SIGKILL}} after the
grace period
> - when sleepDelayBeforeSigKill > 10 seconds, then there is no point of executing DelayedProcessKiller
> - when sleepDelayBeforeSigKill < 1 second, then the grace period should be the smallest
value, which is 1 second, because anyways we are forcing kill after 250 ms

This message was sent by Atlassian JIRA

To unsubscribe, e-mail: yarn-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: yarn-issues-help@hadoop.apache.org

View raw message