You are viewing a plain text version of this content. The canonical link for it is here.
Posted to yarn-issues@hadoop.apache.org by "Eric Yang (JIRA)" <ji...@apache.org> on 2018/11/29 23:56:00 UTC
[jira] [Commented] (YARN-9072) Web browser close without proper
exit can leak shell process
[ https://issues.apache.org/jira/browse/YARN-9072?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16704046#comment-16704046 ]
Eric Yang commented on YARN-9072:
---------------------------------
When a terminal is launched, the process trees are disjoint between what node manager sees and docker.
From Node manager point of view:
{code:java}
yarn 31152 11.0 8.6 3984460 692100 ? Sl 23:01 1:50 /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.141-1.b16.el7_3.x86_64/jre/bin/java -Dproc_nodemanager -Dzookeeper.sasl.
root 815 0.0 0.0 8812 1104 ? S 23:04 0:00 \_ /usr/local/hadoop-3.3.0-SNAPSHOT/bin/container-executor hbase hbase 4 application_1543532485687_0001 conta
root 817 0.0 0.1 156716 11868 ? Sl 23:04 0:00 | \_ /usr/bin/docker run --name=container_1543532485687_0001_01_000010 --net=bridge -v /usr/local/hadoop-3.
root 3291 0.0 0.0 8672 888 ? S 23:11 0:00 \_ /usr/local/hadoop-3.3.0-SNAPSHOT/bin/container-executor --exec-container /tmp/hadoop-yarn/nm-local-dir/nmP
root 3293 0.0 0.1 231856 11704 pts/1 Ssl+ 23:11 0:00 \_ /usr/bin/docker exec -it container_1543532485687_0001_01_000010 /bin/bash -i
{code}
From Docker point of view:
{code:java}
root 6525 0.6 1.1 2392948 95508 ? Ssl Sep13 744:58 /usr/bin/dockerd
root 6532 0.1 0.2 1007808 18556 ? Ssl Sep13 130:40 \_ docker-containerd -l unix:///var/run/docker/libcontainerd/docker-containerd.sock --metrics-interval=0 --start-timeout 2m --state-dir /var/run/docker/libcontainerd/containerd --shim d
root 929 0.0 0.0 282556 6344 ? Sl 23:04 0:00 \_ docker-containerd-shim 842617b842f2f125b7be305a14043f5c2569bf8ca1c86b46598b76096f921631 /var/run/docker/libcontainerd/842617b842f2f125b7be305a14043f5c2569bf8ca1c86b46598b76096f92
root 952 0.0 0.0 7768 568 ? Ss 23:04 0:00 | \_ sleep 10000
root 2256 0.0 0.0 347836 4364 ? Sl 23:08 0:00 \_ docker-containerd-shim 842617b842f2f125b7be305a14043f5c2569bf8ca1c86b46598b76096f921631 /var/run/docker/libcontainerd/842617b842f2f125b7be305a14043f5c2569bf8ca1c86b46598b76096f92
root 2272 0.0 0.0 15256 2012 ? Ss 23:08 0:00 \_ /bin/bash -i
root 2331 0.0 0.0 59548 2020 ? S+ 23:08 0:01 \_ top
{code}
There is no connections between node manager spawned process and docker spawned process. Docker exec does not tell container-executor about the child pid that is spawned in the container. This makes signal decent into child process tree difficult because there is no reference to link the process spawned in docker is related to container-executor.
Patch 001 will send exit instruction to shell to attempt termination of docker exec process for proper clean up. However, container terminal runs other processes and not at a shell prompt, then the exit instruction may not trigger proper clean up until the docker container is fully terminated.
> Web browser close without proper exit can leak shell process
> ------------------------------------------------------------
>
> Key: YARN-9072
> URL: https://issues.apache.org/jira/browse/YARN-9072
> Project: Hadoop YARN
> Issue Type: Sub-task
> Reporter: Eric Yang
> Assignee: Eric Yang
> Priority: Major
> Attachments: YARN-9072.001.patch
>
>
> If web browser is closed without typing exit in container shell, it will leave bash process in the docker container. It would be nice to detect the websocket is closed, and terminate the bash process from docker container.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: yarn-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: yarn-issues-help@hadoop.apache.org