[
https://issues.apache.org/jira/browse/AIRFLOW-6250?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16997122#comment-16997122
]
ASF GitHub Bot commented on AIRFLOW-6250:
-----------------------------------------
ashb commented on pull request #6812: [AIRFLOW-6250] handle_failure needs
better default for context and test_mode
URL: https://github.com/apache/airflow/pull/6812
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> on_failure_callback does not know the task_id when handle_failure() is called
> without passing context
> -----------------------------------------------------------------------------------------------------
>
> Key: AIRFLOW-6250
> URL: https://issues.apache.org/jira/browse/AIRFLOW-6250
> Project: Apache Airflow
> Issue Type: Improvement
> Components: scheduler
> Affects Versions: 1.10.6
> Reporter: Qian Yu
> Assignee: Qian Yu
> Priority: Major
>
> The following code in scheduler_job.py can be hit e.g when
> {{send_task_to_executor()}} in celery_executor.py is too slow and times out
> after 2 seconds. But this call to {{handle_failure}}() is not passing a
> {{context}} object.
> So the {{on_failure_callback}} and on_retry_callback of tasks don't have an
> idea about what task failed.
>
> This can be fixed by making handle_failure() derive some reasonable default
> value for the context argument.
>
> {code:python}
> simple_dag = simple_dag_bag.get_dag(dag_id)
> dagbag = models.DagBag(simple_dag.full_filepath)
> dag = dagbag.get_dag(dag_id)
> ti.task = dag.get_task(task_id)
> ti.handle_failure(msg)
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)