Skip to content
This repository has been archived by the owner on May 22, 2021. It is now read-only.

Commit

Permalink
[AIRFLOW-6358] - log details of failed task (apache#6908)
Browse files Browse the repository at this point in the history
  • Loading branch information
tooptoop4 authored and galuszkak committed Mar 5, 2020
1 parent 8515d38 commit ee31c3b
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions airflow/models/taskinstance.py
Original file line number Diff line number Diff line change
Expand Up @@ -1104,9 +1104,23 @@ def handle_failure(self, error, test_mode=None, context=None, session=None):
else:
self.state = State.FAILED
if task.retries:
self.log.info('All retries failed; marking task as FAILED')
self.log.info(
'All retries failed; marking task as FAILED.'
'dag_id=%s, task_id=%s, execution_date=%s, start_date=%s, end_date=%s',
self.dag_id,
self.task_id,
self.execution_date.strftime('%Y%m%dT%H%M%S'),
self.start_date.strftime('%Y%m%dT%H%M%S'),
self.end_date.strftime('%Y%m%dT%H%M%S'))
else:
self.log.info('Marking task as FAILED.')
self.log.info(
'Marking task as FAILED.'
'dag_id=%s, task_id=%s, execution_date=%s, start_date=%s, end_date=%s',
self.dag_id,
self.task_id,
self.execution_date.strftime('%Y%m%dT%H%M%S'),
self.start_date.strftime('%Y%m%dT%H%M%S'),
self.end_date.strftime('%Y%m%dT%H%M%S'))
if task.email_on_failure and task.email:
self.email_alert(error)
except Exception as e2:
Expand Down

0 comments on commit ee31c3b

Please sign in to comment.