当schedule_interval设置为@once时,只有第一个任务在气流中执行

时间:2019-06-24 20:25:09

标签: airflow airflow-scheduler

我正在使用以下dag测试气流1.10:

dag = DAG(dag_id='something',
start_date=datetime(2019,1,2).replace(tzinfo=pytz.timezone('US/Eastern')),
schedule_interval='@once',
...)

然后我有几个bash运算符:

o1 = BashOperator(bash_command="echo 0", dag=dag, task_id='o1')
o2 = BashOperator(bash_command="echo 0", dag=dag, task_id='o2')
o3 = BashOperator(bash_command="echo 0", dag=dag, task_id='o3')
o1 >> o2 >> o3

Airflow解析并显示dag没问题。但是,当我触发dag时,只有第一个任务运行并被标记为绿色。然后,dag只会保持“正在运行”状态,而所有其他任务都标记为白色,这意味着它们不会被调度程序接收。然后,我收到一封电子邮件,提示:

Executor reports task instance finished (success) although the task says its queued. Was the task killed externally?

1 个答案:

答案 0 :(得分:0)

好吧..我想我明白了,问题出在时区感知的start_date上。一旦我删除了replace(tzinfo=pytz.timezone('US/Eastern'))

,问题就消失了