Airflow 简单任务在没有日志的情况下失败,具有较小的并行度 LocalExecutor(与 SequentialExecutor 一起工作)

Airflow simple tasks failing without logs with small parallelism LocalExecutor (was working with SequentialExecutor)

运行 airflow (v1.10.5) dag 运行 与 SequentialExecutor 兼容现在有许多(虽然不是全部)简单的任务在 [=24 时没有任何日志信息失败=] LocalExecutor 和最小并行度,例如

<airflow.cfg>

# overall task concurrency limit for airflow
parallelism = 8 # which is same as number of cores shown by lscpu
# max tasks per dag
dag_concurrency = 2
# max instances of a given dag that can run on airflow
max_active_runs_per_dag = 1
# max threads used per worker / core
max_threads = 2

# 40G of RAM available total
# CPUs: 8 (sockets 4, cores per socket 4)

see https://www.astronomer.io/guides/airflow-scaling-workers/

查看 airflow-webserver.* 日志没有任何异常,但查看 airflow-scheduler.out 我明白了...

[airflow@airflowetl airflow]$ tail -n 20 airflow-scheduler.out
....
[2019-12-18 11:29:17,773] {scheduler_job.py:1283} INFO - Executor reports execution of mydag.task_level1_table1 execution_date=2019-12-18 21:21:48.424900+00:00 exited with status failed for try_number 1
[2019-12-18 11:29:17,779] {scheduler_job.py:1283} INFO - Executor reports execution of mydag.task_level1_table2 execution_date=2019-12-18 21:21:48.424900+00:00 exited with status failed for try_number 1
[2019-12-18 11:29:17,782] {scheduler_job.py:1283} INFO - Executor reports execution of mydag.task_level1_table3 execution_date=2019-12-18 21:21:48.424900+00:00 exited with status failed for try_number 1
[2019-12-18 11:29:18,833] {scheduler_job.py:832} WARNING - Set 1 task instances to state=None as their associated DagRun was not in RUNNING state
[2019-12-18 11:29:18,844] {scheduler_job.py:1283} INFO - Executor reports execution of mydag.task_level1_table4 execution_date=2019-12-18 21:21:48.424900+00:00 exited with status success for try_number 1
....

但不确定要从中得到什么。

有人知道这里会发生什么或如何获得更有用的调试信息吗?

再次查看我的 lscpu 规格,我注意到...

[airflow@airflowetl airflow]$ lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                8
On-line CPU(s) list:   0-7
Thread(s) per core:    1
Core(s) per socket:    4
Socket(s):             2

通知Thread(s) per core: 1

查看我的 airflow.cfg 设置,我看到了 max_threads = 2。设置 max_threads = 1 并重新启动 scheduler 似乎已经解决了问题。

如果有人知道更多关于幕后到底出了什么问题(例如,为什么任务失败而不是仅仅等待另一个线程可用),将会有兴趣了解一下。