Dark Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix signal handling in triggerer job runner#60190

Merged
potiuk merged 1 commit intoapache:mainfrom
astronomer:fix_signal_handling_triggerer
Jan 7, 2026
Merged

Fix signal handling in triggerer job runner#60190
potiuk merged 1 commit intoapache:mainfrom
astronomer:fix_signal_handling_triggerer

Conversation

Copy link
Member

jedcunningham commented Jan 6, 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.

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.
jedcunningham requested review from dstandish and hussein-awala as code owners January 6, 2026 22:28
boring-cyborg bot added the area:Triggerer label Jan 6, 2026
potiuk approved these changes Jan 6, 2026
jason810496 added the backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch label Jan 7, 2026
jason810496 approved these changes Jan 7, 2026
amoghrajesh approved these changes Jan 7, 2026
ashb reviewed Jan 7, 2026
Copy link
Member

ashb left a comment *
edited
Loading

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

uranusjr approved these changes Jan 7, 2026
Copy link
Member

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.

Copy link
Member

uranusjr commented Jan 7, 2026 *
edited
Loading

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.

hussein-awala approved these changes Jan 7, 2026
potiuk approved these changes Jan 7, 2026
potiuk added this to the Airflow 3.1.6 milestone Jan 7, 2026
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>
Copy link

github-actions bot commented Jan 7, 2026

Backport successfully created: v3-1-test

Status Branch Result
v3-1-test

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 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.
jhgoebbert pushed a commit to jhgoebbert/airflow_Owen-CH-Leung that referenced this pull request Feb 8, 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.
Subham-KRLX pushed a commit to Subham-KRLX/airflow that referenced this pull request Mar 4, 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

Reviewers

ashb ashb left review comments

potiuk potiuk approved these changes

uranusjr uranusjr approved these changes

hussein-awala hussein-awala approved these changes

amoghrajesh amoghrajesh approved these changes

jason810496 jason810496 approved these changes

dstandish Awaiting requested review from dstandish dstandish is a code owner

Assignees

No one assigned

Labels

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

Projects

None yet

Milestone

Airflow 3.1.6

Development

Successfully merging this pull request may close these issues.

7 participants