You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by je...@apache.org on 2021/10/20 21:26:51 UTC

[airflow] 06/10: Workaround libstdcpp TLS error (#19010)

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

jedcunningham pushed a commit to branch v2-2-test
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit f3f0eb2fd219655a4aa37d579a8480313af0d1e9
Author: Jarek Potiuk <ja...@potiuk.com>
AuthorDate: Tue Oct 19 00:03:58 2021 -0100

    Workaround libstdcpp TLS error (#19010)
    
    Workaround https://github.com/apache/airflow/issues/17546 issue with
    /usr/lib/x86_64-linux-gnu/libstdc++.so.6: cannot allocate memory in
    static TLS block.
    
    We do not yet a more "correct" solution to the problem but in order to
    avoid raising new issues by users of the prod image, we implement the
    workaround now.
    
    The side effect of this is slightly (in the range of 100s of
    milliseconds) slower load for any binary started and a little memory
    used for Heap allocated by initialization of libstdc++.
    
    This overhead is not happening for binaries that already link
    dynamically libstdc++.
    
    (cherry picked from commit 88583095c408ef9ea60f793e7072e3fd4b88e329)
---
 Dockerfile    |  9 +++++++++
 Dockerfile.ci | 10 ++++++++++
 2 files changed, 19 insertions(+)

diff --git a/Dockerfile b/Dockerfile
index 4e4bbe8..088d561 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -487,5 +487,14 @@ LABEL org.apache.airflow.distro="debian" \
 # to learn more about the way how signals are handled by the image
 ENV DUMB_INIT_SETSID="1"
 
+# This one is to workaround https://github.com/apache/airflow/issues/17546
+# issue with /usr/lib/x86_64-linux-gnu/libstdc++.so.6: cannot allocate memory in static TLS block
+# We do not yet a more "correct" solution to the problem but in order to avoid raising new issues
+# by users of the prod image, we implement the workaround now.
+# The side effect of this is slightly (in the range of 100s of milliseconds) slower load for any
+# binary started and a little memory used for Heap allocated by initialization of libstdc++
+# This overhead is not happening for binaries that already link dynamically libstdc++
+ENV LD_PRELOAD="/usr/lib/x86_64-linux-gnu/libstdc++.so.6"
+
 ENTRYPOINT ["/usr/bin/dumb-init", "--", "/entrypoint"]
 CMD []
diff --git a/Dockerfile.ci b/Dockerfile.ci
index 0e665f3..b4eb465 100644
--- a/Dockerfile.ci
+++ b/Dockerfile.ci
@@ -400,6 +400,16 @@ LABEL org.apache.airflow.distro="debian" \
   org.opencontainers.image.title="Continuous Integration Airflow Image" \
   org.opencontainers.image.description="Installed Apache Airflow with Continuous Integration dependencies"
 
+# This one is to workaround https://github.com/apache/airflow/issues/17546
+# issue with /usr/lib/x86_64-linux-gnu/libstdc++.so.6: cannot allocate memory in static TLS block
+# We do not yet a more "correct" solution to the problem but in order to avoid raising new issues
+# by users of the prod image, we implement the workaround now.
+# The side effect of this is slightly (in the range of 100s of milliseconds) slower load for any
+# binary started and a little memory used for Heap allocated by initialization of libstdc++
+# This overhead is not happening for binaries that already link dynamically libstdc++
+ENV LD_PRELOAD="/usr/lib/x86_64-linux-gnu/libstdc++.so.6"
+
+
 EXPOSE 8080
 
 ENTRYPOINT ["/usr/bin/dumb-init", "--", "/entrypoint"]