jedcunningham commented on a change in pull request #18068:
URL: https://github.com/apache/airflow/pull/18068#discussion_r706247473
##########
File path: Dockerfile
##########
@@ -479,6 +479,7 @@ LABEL org.apache.airflow.distro="debian" \
org.opencontainers.image.title="Production Airflow Image" \
org.opencontainers.image.description="Reference, production-ready Apache
Airflow image"
+ENV DUMB_INIT_SETSID="1"
Review comment:
Since its the default, do we really care to set it?
##########
File path: chart/templates/workers/worker-deployment.yaml
##########
@@ -180,6 +180,10 @@ spec:
envFrom:
{{- include "custom_airflow_environment_from" . | default "\n []" |
indent 10 }}
env:
+ # For images before Airflow 2.1.4 setting DUMB_INIT_SESSID to 0
fixes signal propagation
+ # to make Warm Shutdown works properly for Celery Workers
Review comment:
```suggestion
# Only signal the main process, not the process group, to make
Warm Shutdown work properly
```
##########
File path: docs/docker-stack/entrypoint.rst
##########
@@ -161,6 +161,34 @@ If there are any other arguments - they are simply passed
to the "airflow" comma
> docker run -it apache/airflow:2.1.2-python3.6 version
2.1.2
+Signal propagation
+------------------
+
+Airflow uses ``dumb-init`` to run as "init" in the entrypoint. This is in
order to propagate
+signals and reap child processes properly. This means that the process that
you run, does not have
Review comment:
```suggestion
signals and reap child processes properly. This means that the process that
you run does not have
```
##########
File path: docs/docker-stack/entrypoint.rst
##########
@@ -161,6 +161,34 @@ If there are any other arguments - they are simply passed
to the "airflow" comma
> docker run -it apache/airflow:2.1.2-python3.6 version
2.1.2
+Signal propagation
+------------------
+
+Airflow uses ``dumb-init`` to run as "init" in the entrypoint. This is in
order to propagate
+signals and reap child processes properly. This means that the process that
you run, does not have
+to install signal handlers to work properly and be killed when the container
is gracefully terminated.
+The behaviour of signal propagation is configured by ``DUMB_INIT_SETSID``
variable which is set to
+``1`` by default - meaning that the signals will be propagated to the whole
process group, but you can
+set it to ``0`` to enable ``single-child`` behaviour of ``dumb-init`` which
only propagates the
+signals to only single child process.
+
+
++------------------+-----------------------------------------------------------------------------------------------+
+| DUMB_INIT_SETSID | Use case
|
++------------------+-----------------------------------------------------------------------------------------------+
+| 1 (default) | If you run your processes as ``["bash", "-c"]`` command,
and bash spawn some new processes, |
Review comment:
I think this should be refactored to have "propagate signals to all
processes in the process group" come before the `bash` example, as the bash bit
really is just one example not core to this setting.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]