气流列表 dag 恰好在 30 秒后超时 [英] Airflow list dag times out exactly after 30 seconds
问题描述
我有一个动态气流 dag(backfill_dag
),它基本上读取管理变量 (Json) 并自行构建.Backfill_dag
用于回填/历史加载,例如,如果我想以某种顺序历史加载 dag x,y, nz(xny 并行运行,z 取决于 x)那么我会提到这一点以特定的 json 格式将其放入 backfill_dag
的管理变量中.
I have a dynamic airflow dag(backfill_dag
) that basically reads admin variable(Json) and builds it self. Backfill_dag
is used for backfilling/history loading, so for example if I wants to history load dag x,y, n z in some order(x n y run in parallel, z depends on x) then I will mention this in a particular json format and put it in admin variable of backfill_dag
.
Backfill_dag
现在:
解析 Json,渲染 dag x、y 和 z 的任务,以及使用 x 和 y 并行构建自身,z 依赖于 x
parses the Json, renders the tasks of the dags x,y, and z, and builds itself dynamically with x and y in parallel and z depends on x
问题:
只要 Backfill_dag
可以在 30 秒内列出_dags,它就可以很好地工作.由于 Backfill_dag
在这里有点复杂,列出需要 30 多秒(airflow list_dags -sd Backfill_dag.py),因此它超时并且 dag 中断.
It works good as long as Backfill_dag
can list_dags in 30 seconds.
Since Backfill_dag
is bit complex here, it takes more than 30 seconds to list(airflow list_dags -sd Backfill_dag.py), hence it times out and the dag breaks.
尝试过:
我试图在调度程序的 airflow.cfg
文件中设置一个参数 dagbag_import_timeout = 100
,但这没有帮助.
I tried to set a parameter, dagbag_import_timeout = 100
, in airflow.cfg
file of the scheduler, but that did not help.
推荐答案
我修复了我的代码.
修复:我的 dag 中有一些 aws s3 cp 命令正在编译期间运行,因此我的 list_dags 命令花费了 30 多秒,我删除了它们(或者在 BashOperator 任务中删除了它们),现在我的代码在几秒钟内编译(list_dags).
Fix: I had some aws s3 cp command in my dag that were running durring compilation hence my list_dags command was taking more than 30 seconds, i removed them(or had then in a BashOperator task), now my code compiles(list_dags) in couple of seconds.
这篇关于气流列表 dag 恰好在 30 秒后超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!