如何在 Apache Airflow 中重新运行所有失败的任务? [英] How to re-run all failed tasks in Apache Airflow?
问题描述
我有一个包含数万个任务的 Apache Airflow DAG,在运行后,说其中有几个失败了.
I have a Apache Airflow DAG with tens of thousands of tasks and after a run, say a handful of them failed.
我修复了导致某些任务失败的错误,我想重新运行仅失败的任务.这个 SO
帖子建议使用 GUI 来清除"失败的任务:
I fixed the bug that caused some tasks to fail and I would like to re-run ONLY FAILED TASKS.
This SO
post suggests using the GUI to "clear" failed task:
如果您有少量失败的任务,则此方法有效.
This approach works if you have a handful number of failed tasks.
我想知道我们是否可以绕过 GUI 并通过以下命令行来解决问题:
I am wondering if we can bypass the GUI and do it problematically, through command line something like:
airflow_clear_failed_tasks dag_id execution_data
推荐答案
使用以下命令仅清除失败的任务:
Use the following command to clear only failed tasks:
airflow clear [-s START_DATE] [-e END_DATE] --only_failed dag_id
文档:https://airflow.readthedocs.io/en/stable/cli.html#clear
这篇关于如何在 Apache Airflow 中重新运行所有失败的任务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!