【问题标题】:Only the first task in a dag gets executed in airflow when schedule_interval set to @once当 schedule_interval 设置为 @once 时,只有 dag 中的第一个任务在气流中执行
【发布时间】:2019-06-24 20:25:09
【问题描述】:

我正在使用以下 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?

【问题讨论】:

    标签: airflow airflow-scheduler


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 2021-04-20
      • 1970-01-01
      • 1970-01-01
      • 2021-04-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多