From 1a4c16432b8718189269e63c3afcd2709eed7379 Mon Sep 17 00:00:00 2001 From: Rajat Srivastava Date: Tue, 15 Oct 2019 00:05:28 +0530 Subject: [PATCH] [AIRFLOW-5653] Log caught AirflowSkipException in task instance log (#6330) [AIRFLOW-5653] Log caught AirflowSkipException in task instance log Logging any caught AirflowSkipException with message in models/taskinstance.py to remove confusion due to no task skipping information in the logs --- airflow/models/taskinstance.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/airflow/models/taskinstance.py b/airflow/models/taskinstance.py index 9edb71d8e205c7..ef8b91b17dc53e 100644 --- a/airflow/models/taskinstance.py +++ b/airflow/models/taskinstance.py @@ -950,7 +950,10 @@ def signal_handler(signum, frame): Stats.incr('ti_successes') self.refresh_from_db(lock_for_update=True) self.state = State.SUCCESS - except AirflowSkipException: + except AirflowSkipException as e: + # log only if exception has any arguments to prevent log flooding + if e.args: + self.log.info(e) self.refresh_from_db(lock_for_update=True) self.state = State.SKIPPED except AirflowRescheduleException as reschedule_exception: