You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "1fanwang (via GitHub)" <gi...@apache.org> on 2026/05/05 09:11:39 UTC
[PR] Extend listener hook-name log to remaining call sites [airflow]
1fanwang opened a new pull request, #66397:
URL: https://github.com/apache/airflow/pull/66397
## Description
Follow-up to #66395, which introduced the hook-name-in-log change for the
task instance listener call sites. This PR applies the identical mechanical
edit to the remaining listener-call surfaces so the suppressed-exception
log message identifies which listener hook raised across the entire codebase.
## Surfaces covered
- **DagRun state changes** —
``airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_run.py``
(``on_dag_run_success``, ``on_dag_run_failed``).
- **DAG import errors** —
``airflow-core/src/airflow/dag_processing/collection.py``
(``on_existing_dag_import_error``, ``on_new_dag_import_error``).
- **Asset events** — ``airflow-core/src/airflow/assets/manager.py``
(``on_asset_created``, ``on_asset_alias_created``, ``on_asset_changed``,
``on_asset_event_emitted``).
- **Component lifecycle** — ``airflow-core/src/airflow/jobs/job.py`` and
``task-sdk/src/airflow/sdk/execution_time/task_runner.py``
(``on_starting``, ``before_stopping``).
After #66395 + this PR land, every listener-call site in airflow-core and
the Task SDK follows the same log format and listener-exception
suppression behavior is preserved.
## Independence from #66395
This PR is **not stacked**: it touches only the call sites that #66395 does
not. The two PRs can land in either order without conflict.
## Testing
The change is purely mechanical (single-line literal edit per call site).
Coverage of the new log format on a non-task-instance hook is added as
``test_listener_lifecycle_error_log_includes_hook_name`` in
``airflow-core/tests/unit/listeners/test_listeners.py``: it registers a
listener that raises in ``on_starting``, instantiates a ``Job`` to fire
the hook, and asserts the captured log includes ``"on_starting"``.
The existing ``test_listener_suppresses_exceptions`` continues to cover
the task-instance path.
<!-- Please keep an empty line above the dashes. -->
---
**^ Add meaningful description above**
Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-guidelines)** for more information.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Extend listener hook-name log to remaining call sites [airflow]
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on PR #66397:
URL: https://github.com/apache/airflow/pull/66397#issuecomment-4566717658
@1fanwang A few things need addressing before review — see our [Pull Request quality criteria](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-quality-criteria).
- :x: **Merge conflicts**. See [docs](https://github.com/apache/airflow/blob/main/contributing-docs/10_working_with_git.rst).
- :x: **Provider tests**. See [docs](https://github.com/apache/airflow/blob/main/contributing-docs/12_provider_distributions.rst).
No rush.
---
_Note: This comment was drafted by an AI-assisted triage tool and may contain mistakes. Once you have addressed the points above, an Apache Airflow maintainer — a real person — will take the next look at your PR. We use this [two-stage triage process](https://github.com/apache/airflow/blob/main/contributing-docs/25_maintainer_pr_triage.md#why-the-first-pass-is-automated) so that our maintainers' limited time is spent where it matters most: the conversation with you._
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Extend listener hook-name log to remaining call sites [airflow]
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk closed pull request #66397: Extend listener hook-name log to remaining call sites
URL: https://github.com/apache/airflow/pull/66397
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org