Skip to content

feat: Add queues for triggerers. - #36338

Closed
avkirilishin wants to merge 6 commits into
apache:mainfrom
avkirilishin:33818_queues_for_triggerers
Closed

avkirilishin wants to merge 6 commits into
apache:mainfrom
avkirilishin:33818_queues_for_triggerers

Conversation

@avkirilishin

@avkirilishin avkirilishin commented Dec 20, 2023 •

Copy link
Copy Markdown
Contributor

Closes: #33818

Pull Request for discussing the approach. If this approach is acceptable, I will add queue support for more triggers, add tests, update the documentation, and assess the database load under a large number of triggers.

You can check how triggerer's queues work with the sample DAG:

from datetime import time
import pendulum

from airflow import DAG
from airflow.operators.empty import EmptyOperator
from airflow.sensors.time_sensor import TimeSensorAsync


with DAG(
    'trigger-dag',
    schedule='@daily',
    start_date=pendulum.DateTime(2023, 12, 19),
) as dag:
    sensor = TimeSensorAsync(task_id="sync_sensor", target_time=time(10, 59))
    sensor_default = TimeSensorAsync(
        task_id="sync_sensor_default", target_time=time(23, 59), trigger_queue="default")
    sensor_q1 = TimeSensorAsync(task_id="sync_sensor_q1", target_time=time(10, 59), trigger_queue="queue1")
    dummy_op = EmptyOperator(task_id="dummy_op")
    sensor >> dummy_op
    sensor_default >> dummy_op
    sensor_q1 >> dummy_op

And you can run the second triggerer with the following command:

airflow triggerer -q queue1

photo_2023-12-21_02-21-28

image

@eladkal eladkal added this to the Airflow 2.9.0 milestone Dec 28, 2023
@eladkal eladkal added the type:new-feature Changelog: New Features label Dec 28, 2023
@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions.

@github-actions github-actions Bot added the stale Stale PRs per the .github/workflows/stale.yml policy file label Feb 12, 2024
@avkirilishin avkirilishin reopened this Feb 16, 2024
@github-actions github-actions Bot removed the stale Stale PRs per the .github/workflows/stale.yml policy file label Feb 17, 2024
@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions.

@github-actions github-actions Bot added the stale Stale PRs per the .github/workflows/stale.yml policy file label May 23, 2024
@github-actions github-actions Bot closed this Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:API Airflow's REST/HTTP API area:CLI area:scheduler area:Triggerer area:UI Related to UI/UX. For Frontend Developers. area:webserver Webserver related Issues kind:documentation stale Stale PRs per the .github/workflows/stale.yml policy file type:new-feature Changelog: New Features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support dispatching triggers to different triggerer instances.

3 participants