如何在气流 1.8 上出现故障时重新启动 dag? [英] How to restart a dag when it fails on airflow 1.8?

查看:20
本文介绍了如何在气流 1.8 上出现故障时重新启动 dag?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

与:

default_args = {
    ...
    'retries': 1,
    'retry_delay': timedelta (seconds = 1),
    ...
} 

多次重试失败的任务我可以得到,但是当一个任务失败,DAG再次启动时如何得到?

I can get the task that fails to retry several times, but how can I get it when a task fails, the DAG starts again?

当然,自动...

推荐答案

在 Airflow 中对此的规范解决方案是创建一个 subdagooperator,将所有其他任务包装在 dag 中,并对其应用重试.

The canonical solution to this in Airflow is to create a subdagoperator that wraps all the other tasks in the dag, and apply the retry to that.

这篇关于如何在气流 1.8 上出现故障时重新启动 dag?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆