如何在Airflow上重新启动失败的任务
我使用的是 LocalExecutor ,我的任务有 3个任务,其中任务(C)依赖于任务(A)。任务(B)和任务(A)可以并行运行,如下所示:
I am using a LocalExecutor and my dag has 3 tasks where task(C) is dependant on task(A). Task(B) and task(A) can run in parallel something like below
A-> C
B
因此任务(A)失败,但是任务(B)运行正常。任务(C)尚未运行,因为任务(A)失败。
So task(A) has failed and but task(B) ran fine. Task(C) is yet to run as task(A) has failed.
我的问题是我如何单独重新运行任务(A),因此任务( C)在任务(A)完成并且Airflow UI将其标记为成功后运行。
My question is how do i re run Task(A) alone so Task(C) runs once Task(A) completes and Airflow UI marks them as success.
在UI中:
- 转到dag,然后运行dag运行要更改的运行
- 单击GraphView
- 单击任务A
- 单击清除
- Go to the dag, and dag run of the run you want to change
- Click on GraphView
- Click on task A
- Click "Clear"
这将使任务A重新运行,如果成功,则任务C应该运行。
之所以起作用,是因为当您清除任务的状态时,调度程序会将其视为该dag运行之前从未运行过。
This will let task A run again, and if it succeeds, task C should run. This works because when you clear a task's status, the scheduler will treat it as if it hadn't run before for this dag run.