catchup = False,为什么仍要安排两次计划运行?

编程入门 行业动态 更新时间:2024-10-15 06:16:59
本文介绍了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.

github/apache/airflow/pull/8776

issues.apache/jira/browse/AIRFLOW-3369

更多推荐

catchup = False,为什么仍要安排两次计划运行?

本文发布于:2023-11-24 01:12:02,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1623423.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:两次   仍要   计划   catchup   False

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!