catchup = False,为什么仍要安排两次计划运行? [英] catchup = False, why still two schedule runs are scheduled?

查看:785
本文介绍了catchup = False,为什么仍要安排两次计划运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有简单的DAG: (Airflow v1.10.16,在本地主机上使用SequentialExecutor)

I've simple DAG: (Airflow v1.10.16, using SequentialExecutor on localhost machine)

  • 开始日期设置为过去
  • catchup = False
  • start_date set in past
  • catchup = False
default_args = {'owner': 'test_user', 
                'start_date': datetime(2019, 12, 1, 1, 00, 00),}

graph1 = DAG(dag_id = 'test_dag', default_args=default_args,
             schedule_interval=timedelta(days=1),
             catchup = False)

t = PythonOperator(task_id='t', python_callable=my_func, dag=graph1)

按照代码注释

:参数追赶:执行调度程序追赶(或仅运行最新的命令)?

:param catchup: Perform scheduler catchup (or only run latest)?

我希望当调度程序出现时,应该将这个dag运行时间调度为比现在的过去日期一次. 但是,我遇到的行为是:调度程序正在调度最近的两次运行(而不是一次,最近的一次)

I expected when the scheduler comes up, it's supposed to schedule this dag run only once in past date than now. However, the behavior i'm experiencing is: the scheduler is scheduling recent two runs (instead just one, the latest one)

我于2019-12-09 04:03:00Z(=现在)激活了调度程序,以下是任务实例的调度运行:

I activated the scheduler on 2019-12-09 04:03:00Z (= now) and here's Task Instances scheduled runs:

有人可以澄清为什么安排了过去2次而不是一次吗? 我的理解是错误还是错误?

Can someone clarify why 2 runs in past date were scheduled instead just one? is it some bug or something wrong in my understanding?

推荐答案

当使用timedelta作为1.10.11之前版本的计划间隔时,这是Airflow中的错误.使用cron时,它可以按预期工作.现在已在1.10.11中修复.

This is a bug in Airflow when using timedelta as Schedule Interval for version pre-1.10.11. It works as intended when using cron. It is fixed now in 1.10.11.

https://github.com/apache/airflow/pull/8776

https://issues.apache.org/jira/browse/AIRFLOW-3369

这篇关于catchup = False,为什么仍要安排两次计划运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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