Apache Airflow version
2.2.3 (latest released)
What happened
I'm currently using airflow triggers, but I've noticed that deferred tasks are being ran on every triggerer instance right away:
host 1 -> 2/10/2022 1:06:08 PM Job a702656f-01ce-4e7a-893a-5b42cdaa38e2 progressed from Unknown to RUNNABLE.
host 2 -> 2/10/2022 1:06:06 PM Job a702656f-01ce-4e7a-893a-5b42cdaa38e2 progressed from Unknown to RUNNABLE.
within 2 seconds, the job was issued on both triggerer instances.
What you expected to happen
The deferred task is only scheduled on 1 triggerer instance.
How to reproduce
Create many jobs that have to be deferred, and start multiple triggerers.
Operating System
Ubuntu 20.04.3 LTS
Versions of Apache Airflow Providers
2.2.3
Deployment
Other Docker-based deployment
Deployment details
A docker setup w/ multiple triggerer instances running.
Anything else
I believe this issue is due to a race condition here:
. If multiple instances start at the same time, each instance will get the same tasks in their alive_job_ids.
Are you willing to submit PR?
Code of Conduct
Apache Airflow version
2.2.3 (latest released)
What happened
I'm currently using airflow triggers, but I've noticed that deferred tasks are being ran on every triggerer instance right away:
within 2 seconds, the job was issued on both triggerer instances.
What you expected to happen
The deferred task is only scheduled on 1 triggerer instance.
How to reproduce
Create many jobs that have to be deferred, and start multiple triggerers.
Operating System
Ubuntu 20.04.3 LTS
Versions of Apache Airflow Providers
2.2.3
Deployment
Other Docker-based deployment
Deployment details
A docker setup w/ multiple triggerer instances running.
Anything else
I believe this issue is due to a race condition here:
airflow/airflow/models/trigger.py
Line 175 in 84a59a6
Are you willing to submit PR?
Code of Conduct