flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "kathleen sharp (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (FLINK-6300) PID1 of docker images does not behave correctly
Date Wed, 12 Apr 2017 11:50:41 GMT

     [ https://issues.apache.org/jira/browse/FLINK-6300?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

kathleen sharp updated FLINK-6300:
----------------------------------
    Description: 
When running the task manager and job manager docker images the process with PID1 is a bash
script.

There is a problem in using bash as the PID1 process in a docker
container as docker sends SIGTERM, but bash doesn't send this to its
child processes.

This means for example that if a container was ever killed and a child
process had a file open then the file may get corrupted.

It's covered in more detail in a blog post here:
https://blog.phusion.nl/2015/01/20/docker-and-the-pid-1-zombie-reaping-problem/

>From the mailing list (Nico):
"Some background:
Although docker-entrypoint.sh uses "exec" to run succeeding bash scripts for
jobmanager.sh and taskmanager.sh, respectively, and thus replaces itself with
these scripts, they do not seem to use exec themselves for foreground
processes and thus may run into the problem you described.
I may be wrong, but I did not find any other fallback to handle this in the
current code base."

Potentially useful information:

dockerd version 1.1.3 added an init flag:

"You can use the --init flag to indicate that an init process should be used as the PID 1
in the container. Specifying an init process ensures the usual responsibilities of an init
system, such as reaping zombie processes, are performed inside the created container."
from:
https://docs.docker.com/engine/reference/run/#restart-policies---restart

perhaps the fix could be just to update readme for these images to specify to use this flag.

  was:
When running the task manager and job manager docker images the process with PID1 is a bash
script.

There is a problem in using bash as the PID1 process in a docker
container as docker sends SIGTERM, but bash doesn't send this to its
child processes.

This means for example that if a container was ever killed and a child
process had a file open then the file may get corrupted.

It's covered in more detail in a blog post here:
https://blog.phusion.nl/2015/01/20/docker-and-the-pid-1-zombie-reaping-problem/

>From the mailing list (Nico):
"Some background:
Although docker-entrypoint.sh uses "exec" to run succeeding bash scripts for
jobmanager.sh and taskmanager.sh, respectively, and thus replaces itself with
these scripts, they do not seem to use exec themselves for foreground
processes and thus may run into the problem you described.
I may be wrong, but I did not find any other fallback to handle this in the
current code base."

Potentially useful information:

dockerd version 1.1.3 added an init flag:

"You can use the --init flag to indicate that an init process should be used as the PID 1
in the container. Specifying an init process ensures the usual responsibilities of an init
system, such as reaping zombie processes, are performed inside the created container."
from:
https://docs.docker.com/engine/reference/run/#restart-policies---restart


> PID1 of docker images does not behave correctly
> -----------------------------------------------
>
>                 Key: FLINK-6300
>                 URL: https://issues.apache.org/jira/browse/FLINK-6300
>             Project: Flink
>          Issue Type: Bug
>          Components: Docker
>    Affects Versions: 2.0.0, 1.1.4
>         Environment: all
>            Reporter: kathleen sharp
>            Priority: Minor
>
> When running the task manager and job manager docker images the process with PID1 is
a bash script.
> There is a problem in using bash as the PID1 process in a docker
> container as docker sends SIGTERM, but bash doesn't send this to its
> child processes.
> This means for example that if a container was ever killed and a child
> process had a file open then the file may get corrupted.
> It's covered in more detail in a blog post here:
> https://blog.phusion.nl/2015/01/20/docker-and-the-pid-1-zombie-reaping-problem/
> From the mailing list (Nico):
> "Some background:
> Although docker-entrypoint.sh uses "exec" to run succeeding bash scripts for
> jobmanager.sh and taskmanager.sh, respectively, and thus replaces itself with
> these scripts, they do not seem to use exec themselves for foreground
> processes and thus may run into the problem you described.
> I may be wrong, but I did not find any other fallback to handle this in the
> current code base."
> Potentially useful information:
> dockerd version 1.1.3 added an init flag:
> "You can use the --init flag to indicate that an init process should be used as the PID
1 in the container. Specifying an init process ensures the usual responsibilities of an init
system, such as reaping zombie processes, are performed inside the created container."
> from:
> https://docs.docker.com/engine/reference/run/#restart-policies---restart
> perhaps the fix could be just to update readme for these images to specify to use this
flag.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message