gpt4 book ai didi

追赶实例之间的 Airflow 延迟

转载 作者:行者123 更新时间:2023-12-05 02:15:49 35 4
gpt4 key购买 nike

我有以下 dag 设置以从 2015 年开始运行追赶。对于每个执行日期,任务实例在一分钟内完成。但是,第二天的任务仅在 5 分钟窗口内开始。例如。上午 10:00、上午 10:05、上午 10:10 等。我没有看到为任务实例指定的 5 分钟间隔。如何修改 dag 以在前一个实例完成后立即触发?我正在使用 Airflow 版本 1.9.0

default_args = {
'owner': 'ssnehalatha',
'email': ['ssnehalatha@metromile.com'],
'depends_on_past': False,
'start_date': datetime(2015, 1, 1),
'on_failure_callback': jira_failure_ticket,
'trigger_rule': 'all_done',
'retries': 1,
'pool': 'python_sql_pool'
}

dag = DAG('daily_dag',
schedule_interval='15 1 * * 0,1,2,3,4,5',
default_args=default_args,
dagrun_timeout=timedelta(hours=24),
catchup=True)

最佳答案

如果我没记错的话,这与 airflow.cfg 中的调度程序设置有关。

[scheduler]

# The scheduler constantly tries to trigger new tasks (look at the
# scheduler section in the docs for more information). This defines
# how often the scheduler should run (in seconds).
scheduler_heartbeat_sec = 60

编辑

您提到的两个参数的文档(来自 https://github.com/apache/incubator-airflow/blob/master/UPDATING.md ):

min_file_process_interval After how much time should an updated DAG be picked up from the filesystem.

dag_dir_list_interval The frequency with which the scheduler should relist the contents of the DAG directory. If while developing +dags, they are not being picked up, have a look at this number and decrease it when necessary.

在我看来,它们更多地用于检测更改的和新的 DAG 文件,而不是执行任务

关于追赶实例之间的 Airflow 延迟,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51033591/

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com