-
I'm using airflow version 2.5.0. For all the tasks in airflow, after they being queued, there is a mysterious 50 (+/- 2) seconds delay before the tasks actually starts running. I'm using LocalExecutor. And this happens for all tasks, what can be the reasons for this? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
Hard to say without any evidences or logs, and explaining more about your deployment details (database, how you run your airflow/scheduler etc., Ideally some correlation from logs showing when the scheduler schedules the task for execution and when it actually starts. And finding and sharing all the logs from in-between from all the processes you have. Also it very much depends on the database you use. For example if you are using sqlite, then ... don't . Various things might happen. Also such delays often say about some resourcing problems - memory, CPU, networking, sockets, filesystem. all that might have some effect. |
Beta Was this translation helpful? Give feedback.
-
We're using postgresql for the database. Also I might note that the delay is weirdly very consistent at ~50s (+/- 2). So I added logging_level=DEBUG under section [core] to see what happen. After I triggered the dag in the web UI, the dag appeared as "queued" on the UI, however in the scheduler log, it keeps printing 0 running and 0 in queue even though the web UI say the dag/task is queued.
After 50s, the dag starts normally:
|
Beta Was this translation helpful? Give feedback.
-
Hmm, I seem to have found the problem, for some reason the posgresql database clock is 50 seconds slower than the actual time. I'll try to fix the problem with the database soon and report back. |
Beta Was this translation helpful? Give feedback.
-
Everything works as expected after enable ntp service on postgresql server. |
Beta Was this translation helpful? Give feedback.
Hmm, I seem to have found the problem, for some reason the posgresql database clock is 50 seconds slower than the actual time. I'll try to fix the problem with the database soon and report back.