Skip to content

Conversation

@jedcunningham
Copy link
Member

We were not registering our signal handler in the triggerer job. This meant our logging, to improve visibility into the shutdown process, was missing.

Before:

2026-01-06T22:23:41.797530Z [info     ] Starting the triggerer         [airflow.jobs.triggerer_job_runner.TriggererJobRunner] loc=triggerer_job_runner.py:166
^C2026-01-06T22:23:42.811630Z [info     ] Waiting for triggers to clean up [airflow.jobs.triggerer_job_runner.TriggererJobRunner] loc=triggerer_job_runner.py:183
2026-01-06T22:23:42.817552Z [info     ] Process exited                 [supervisor] exit_code=-2 loc=supervisor.py:716 pid=5187 signal_sent=SIGINT
2026-01-06T22:23:42.818042Z [info     ] Exited trigger loop            [airflow.jobs.triggerer_job_runner.TriggererJobRunner] loc=triggerer_job_runner.py:188

After:

2026-01-06T22:24:12.663026Z [info     ] Starting the triggerer         [airflow.jobs.triggerer_job_runner.TriggererJobRunner] loc=triggerer_job_runner.py:166
^C2026-01-06T22:24:20.586689Z [info     ] Exiting gracefully upon receiving signal 2 [airflow.jobs.triggerer_job_runner.TriggererJobRunner] loc=triggerer_job_runner.py:157
2026-01-06T22:24:20.718223Z [info     ] Waiting for triggers to clean up [airflow.jobs.triggerer_job_runner.TriggererJobRunner] loc=triggerer_job_runner.py:184
2026-01-06T22:24:20.718660Z [info     ] Process exited                 [supervisor] exit_code=0 loc=supervisor.py:716 pid=6382 signal_sent=SIGINT
2026-01-06T22:24:20.718819Z [info     ] Exited trigger loop            [airflow.jobs.triggerer_job_runner.TriggererJobRunner] loc=triggerer_job_runner.py:189

We were not registering our signal handler in the triggerer job. This
meant our logging, to improve visibility into the shutdown process, was
missing.
@jason810496 jason810496 added the backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch label Jan 7, 2026
Copy link
Member

@ashb ashb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is running async loop we souls use that for signal handling, not the sync version

https://docs.python.org/3/library/asyncio-eventloop.html#unix-signals

Copy link
Member

@uranusjr uranusjr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, although I wonder if there’s a better way to manage these instead of have register calls in (seemingly) random places.

@uranusjr
Copy link
Member

uranusjr commented Jan 7, 2026

Using add_signal_handler is not technically required here. Signal handling is fundamentally synchronous; the loop method is needed when you want to use the eventloop (to do async stuff, for example) in the handler. We don’t here. It’s probably still a good idea to use the method anyway though as a best practice measure and to prevent future mistakes.

@potiuk potiuk added this to the Airflow 3.1.6 milestone Jan 7, 2026
@potiuk potiuk merged commit ee163cd into apache:main Jan 7, 2026
72 checks passed
github-actions bot pushed a commit that referenced this pull request Jan 7, 2026
We were not registering our signal handler in the triggerer job. This
meant our logging, to improve visibility into the shutdown process, was
missing.
(cherry picked from commit ee163cd)

Co-authored-by: Jed Cunningham <66968678+jedcunningham@users.noreply.github.com>
@github-actions
Copy link

github-actions bot commented Jan 7, 2026

Backport successfully created: v3-1-test

Status Branch Result
v3-1-test PR Link

potiuk pushed a commit that referenced this pull request Jan 7, 2026
)

We were not registering our signal handler in the triggerer job. This
meant our logging, to improve visibility into the shutdown process, was
missing.
(cherry picked from commit ee163cd)

Co-authored-by: Jed Cunningham <66968678+jedcunningham@users.noreply.github.com>
@jedcunningham jedcunningham deleted the fix_signal_handling_triggerer branch January 7, 2026 18:30
chirodip98 pushed a commit to chirodip98/airflow-contrib that referenced this pull request Jan 9, 2026
We were not registering our signal handler in the triggerer job. This
meant our logging, to improve visibility into the shutdown process, was
missing.
stegololz pushed a commit to stegololz/airflow that referenced this pull request Jan 9, 2026
We were not registering our signal handler in the triggerer job. This
meant our logging, to improve visibility into the shutdown process, was
missing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:Triggerer backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants