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

[airflow] 09/22: Enhancement to bash scripts (#17098)

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

potiuk pushed a commit to branch v2-1-test-jarek-cherry-picks
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit 7a43960a5c3c5822c56149ece261ab99c6a92282
Author: Shraman Basyal <49...@users.noreply.github.com>
AuthorDate: Mon Aug 2 14:49:11 2021 -0500

    Enhancement to bash scripts (#17098)
    
    (cherry picked from commit e544ffc2241a067b7433a954f51d9fa91f345c29)
---
 scripts/in_container/prod/airflow_scheduler_autorestart.sh | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/scripts/in_container/prod/airflow_scheduler_autorestart.sh b/scripts/in_container/prod/airflow_scheduler_autorestart.sh
index 09e0344..0fdc644 100755
--- a/scripts/in_container/prod/airflow_scheduler_autorestart.sh
+++ b/scripts/in_container/prod/airflow_scheduler_autorestart.sh
@@ -18,7 +18,11 @@
 
 while echo "Running"; do
     airflow scheduler -n 5
-    echo "Scheduler crashed with exit code $?.  Respawning.." >&2
-    date >> /tmp/airflow_scheduler_errors.txt
+    return_code=$?
+    if (( return_code != 0 )); then
+        echo "Scheduler crashed with exit code $return_code. Respawning.." >&2
+        date >> /tmp/airflow_scheduler_errors.txt
+    fi
+
     sleep 1
 done