This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch v1-10-test
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit a58ed716a56f06f703aa504058d3457e2829a797
Author: Jarek Potiuk <[email protected]>
AuthorDate: Thu Jun 18 16:58:08 2020 +0200

    Fixed crashing webserver after /tmp is mounted from the host (#9378)
    
    The bug was introduced in f17a02d33047ebbfd9f92d3d1d54d6d810f596c1
    
    Gunicorn uses a lot of os.fchmod in /tmp directory and it can create some
    excessive blocking in os.fchmod
    
https://docs.gunicorn.org/en/stable/faq.html#how-do-i-avoid-gunicorn-excessively-blocking-in-os-fchmod
    
    We want to switch to use /dev/shm in prod image (shared memory) to make
    blocking go away and make independent on the docker filesystem used (osxfs 
has
    problems with os.fchmod and use permissions as well).
    
    Use case / motivation
    
    Avoiding contention might be useful = in production image.
    
    This can be done with:
    
    GUNICORN_CMD_ARGS="--worker-tmp-dir /dev/shm"
    
    (cherry picked from commit 4fefaf78a291bee3826f4bd97a9518f7e31f9033)
---
 Dockerfile.ci | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Dockerfile.ci b/Dockerfile.ci
index 232711b..651810d 100644
--- a/Dockerfile.ci
+++ b/Dockerfile.ci
@@ -313,6 +313,9 @@ WORKDIR ${AIRFLOW_SOURCES}
 
 ENV PATH="${HOME}:${PATH}"
 
+# Needed to stop Gunicorn from crashing when /tmp is now mounted from host
+ENV GUNICORN_CMD_ARGS="--worker-tmp-dir /dev/shm/"
+
 EXPOSE 8080
 
 ENTRYPOINT ["/usr/bin/dumb-init", "--", "/entrypoint"]

Reply via email to