气流CRON计划间隔无法正确触发DAG
Airflow-version: **1.10.10**
Cron: "30 07,08,11,15 * * *"
DAG预计将以7:30,8:30,11:30,15:30
运行 但是始终将DAG从11:30,15:30,19:30,20:30
开始触发。 其中19:30,20:30
在Cron表达中根本没有提及。
感谢有人帮助调试此问题。
代码:
CRON_SCHEDULER = "30 07,08,11,15 * * *"
with DAG(
"cron_test_dag",
schedule_interval=CRON_SCHEDULER,
start_date=pendulum.datetime(2021, 1, 1, tz="UTC"),
catchup=False) as dag:
start_job = DummyOperator(task_id='Start_Job', dag=dag)
bash_task1 = BashOperator(
task_id="bash_task1",
bash_command="echo hello world",
dag=dag,
)
start_job >> bash_task1
Airflow-version: **1.10.10**
Cron: "30 07,08,11,15 * * *"
The DAG is expected to run at 7:30, 8:30, 11:30, 15:30
but always DAG will start to trigger from 11:30, 15:30, 19:30, 20:30
where 19:30, 20:30
is not mentioned in cron expression at all.
Appreciate if anyone help to debug this issue.
code:
CRON_SCHEDULER = "30 07,08,11,15 * * *"
with DAG(
"cron_test_dag",
schedule_interval=CRON_SCHEDULER,
start_date=pendulum.datetime(2021, 1, 1, tz="UTC"),
catchup=False) as dag:
start_job = DummyOperator(task_id='Start_Job', dag=dag)
bash_task1 = BashOperator(
task_id="bash_task1",
bash_command="echo hello world",
dag=dag,
)
start_job >> bash_task1
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
由于偏移量准确3个小时,我建议尝试更改您的时区。您是否按照您的代码建议在UTC时区?也许您应该将其更改为UTC+03。
As the offset is 3 hours exactly, I suggest trying to change your timezone. Are you in the UTC timezone as your code suggests? Maybe you should change it to UTC+03.
19,20。
由于某种原因,
它将07,08解释为PM小时: 它带有几个版本。
我看不出任何与克罗纳类似问题的错误,所以我怀疑气流,但是我也看不到任何错误……
For some reason it is interpreting 07,08 as pm hours: 19, 20.
I've just tested with the latest version of croniter (used by airflow) and it seems to work as expected, nevertheless the leading 0.
I've tested it with several versions back.
I don't see any bug filed with similar problem to croniter, so I suspect Airflow, but I don't see any bug filed there either…