Skip to content

Deferred tasks being ran on every triggerer instance #21616

Description

@Chris7

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:

alive_triggerer_ids = [
. 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?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions