Skip to content

Include hook name in suppressed listener-exception log - #66395

Closed
1fanwang wants to merge 7 commits into
apache:mainfrom
1fanwang:1fanwang/listener-log-hook-context
Closed

Include hook name in suppressed listener-exception log#66395
1fanwang wants to merge 7 commits into
apache:mainfrom
1fanwang:1fanwang/listener-log-hook-context

Conversation

@1fanwang

@1fanwang1fanwang commented May 5, 2026

Copy link
Copy Markdown
Contributor

Description

When a listener hookimpl raises, the suppressed-exception log line now
identifies which hook raised. The previous generic
log.exception(\"error calling listener\") made it impossible to tell which
of the registered hooks failed without re-reading the stack trace —
especially painful when several listeners are registered and one of them
sporadically misbehaves.

New format:

```text
error calling listener for hook 'on_task_instance_failed'
```

The existing substring error calling listener remains in the message,
so any downstream log-grep tooling continues to match.

Scope

This PR covers the task instance listener call sites only, mirroring
the surface of #66394:

  • task-sdk/src/airflow/sdk/execution_time/task_runner.py — 5 sites
    (running, success, skipped, up_for_retry, failed)
  • airflow-core/src/airflow/models/taskinstance.py — 1 site (API
    server retry path)
  • airflow-core/src/airflow/api_fastapi/core_api/services/public/task_instances.py
    — split the single try/except wrapping three branches into per-branch
    try/except so each log line names exactly one hook

DagRun, asset, dag-processing, and lifecycle listener call sites follow the
same pattern and can be migrated as a follow-up; keeping this PR narrow
makes the diff trivially reviewable.

Behavior

Listener-exception suppression is preserved — task execution is not
affected by listener failures.

Testing

  • Existing test test_listener_suppresses_exceptions (airflow-core) is
    extended to also assert the hook name appears in the captured log
    output. It uses the existing throwing_listener fixture which raises
    in on_task_instance_success.
  • New unit test test_listener_error_log_includes_hook_name (task-sdk)
    registers a listener that raises in on_task_instance_success,
    drives the runner, and asserts log.exception was called with
    (\"error calling listener for hook %r\", \"on_task_instance_success\").

^ Add meaningful description above
Read the Pull Request Guidelines for more information.

E2E validation

=== TI listener call sites with hook name in log ===
task-sdk/src/airflow/sdk/execution_time/task_runner.py:1181 hook='on_task_instance_running'
task-sdk/src/airflow/sdk/execution_time/task_runner.py:1906 hook='on_task_instance_success'
task-sdk/src/airflow/sdk/execution_time/task_runner.py:1914 hook='on_task_instance_skipped'
task-sdk/src/airflow/sdk/execution_time/task_runner.py:1922 hook='on_task_instance_failed'
task-sdk/src/airflow/sdk/execution_time/task_runner.py:1932 hook='on_task_instance_failed'
airflow-core/src/airflow/models/taskinstance.py:1779 hook='on_task_instance_failed'
airflow-core/src/airflow/api_fastapi/.../task_instances.py:83 hook='on_task_instance_success'
airflow-core/src/airflow/api_fastapi/.../task_instances.py:92 hook='on_task_instance_failed'
airflow-core/src/airflow/api_fastapi/.../task_instances.py:97 hook='on_task_instance_skipped'
Runtime log call: call('error calling listener for hook %r', 'on_task_instance_failed')

9/9 TI listener call sites updated. Lifecycle hooks (on_starting, before_stopping) are scoped to the follow-up #66397.

Real e2e validation (Airflow standalone)

Re-ran with airflow standalone (real scheduler + API server + LocalExecutor + sqlite). Registered a listener that raises on every TI hook; observed the new log format on every suppressed exception:

error calling listener for hook 'on_task_instance_running' (raised in _prepare, task_runner.py:1181)
error calling listener for hook 'on_task_instance_success' (raised in finalize, task_runner.py:1906)
error calling listener for hook 'on_task_instance_failed' (raised in finalize, task_runner.py:1932)
error calling listener for hook 'on_task_instance_skipped' (raised in finalize, task_runner.py:1914)

All 4 TI hooks now identify themselves by name in the log when an impl raises. Listener-exception suppression behavior is preserved — the DAGs that triggered these errors all completed normally (success/failed/skipped) regardless of the listener throwing.

Integrated mega-branch validation (all 7 PRs composed)

This PR was independently validated, plus all seven PRs in this stack (#66394, #66395, #66397, #66399, #66402, #66405, #66410) were merged onto a single branch and exercised end-to-end through real services — airflow standalone running scheduler + API server + LocalExecutor + Postgres-equivalent (sqlite for the test). A single listener plugin declaring every new hook and parameter was registered, then 5 DAGs covering every state-transition path were triggered + a manual-set-state PATCH via the public API was issued. The listener log is below — every annotation maps a line to the PR that introduced it:

running prev=QUEUED msg=started task=ok_task ← PR-A msg arg
success prev=RUNNING msg=success task=ok_task ← PR-A
running prev=QUEUED msg=started task=boom_task
failed prev=RUNNING msg=failed task=boom_task error_type=ValueError fd=None ← PR-A + PR-D + PR-F kwarg
running prev=QUEUED msg=started task=skip_task
skipped prev=RUNNING msg=skipped task=skip_task ← PR-A skipped path
running prev=QUEUED msg=started task=retry_task
failed prev=RUNNING msg=up_for_retry task=retry_task error_type=ValueError ← PR-A retry-vs-terminal
running prev=QUEUED msg=started task=retry_task (try 2 of 2)
failed prev=RUNNING msg=failed task=retry_task error_type=ValueError
running prev=QUEUED msg=started task=checkpoint_task
checkpointed prev=RUNNING task=checkpoint_task checkpoint_data={'step': 5,
'iterator_offset': 1024} ← PR-E + PR-G
--- BEGIN MANUAL SET (PATCH /api/v2/.../taskInstances/ok_task new_state=failed) ---
failed prev=None msg=manually_set_to_failed task=ok_task error_type=RuntimeError fd=None ← PR-D RuntimeError wrap
(would be `str` on the PR-A-only branch)

What this validates jointly:

PRSurfaceEvidence in log
#66394 (msg arg)every TI hook has msg=...6 canonical values fire (started, success, failed, skipped, up_for_retry, manually_set_to_failed)
#66395 (hook-name log, TI)logs identify the failing hooktested separately with throwing listener — see PR body
#66397 (hook-name log, rest)lifecycle / DagRun / asset surfacestested separately with throwing listener — see PR body
#66399 (tighten error type)error: BaseException | Nonemanual-set path delivers RuntimeError (was str on PR-A alone)
#66402 (CHECKPOINTED state)worker catches AirflowTaskCheckpointedrunning → checkpointed transition observed at the listener and at the supervisor message boundary
#66405 (FailureDetails)listener can declare failure_details kwargfailure_details=None flowing through every failure (no executor populates yet)
#66410 (on_task_instance_checkpointed)new hook fires with payloadcheckpointed task=checkpoint_task checkpoint_data={'step': 5, ...}

Repro

# Combine all 7 branches onto a mega branch (resolve trivial overlap on the# spec file's failure hook signature — error + msg + failure_details kwargs# in one signature) and install editable:
pip install -e shared/listeners -e task-sdk -e airflow-core
AIRFLOW__CORE__EXECUTOR=LocalExecutor airflow standalone &# Drop the recording listener (declares all 5 hooks including the new# checkpointed one) into $AIRFLOW_HOME/plugins/, drop 5 DAGs into dags/# (success / failed / skipped / retry-then-fail / checkpointed), trigger them.fordagin e2e_success e2e_failed e2e_skipped e2e_retry_then_fail e2e_checkpointed;do
airflow dags trigger $dagdone# Then PATCH a state via the public API to exercise the manual path.

Bugs surfaced and fixed during this validation

This step caught 6 bugs that the layer-2 unit-test pass missed — every fix is a separate commit on its respective PR's branch:

Last two would have broken every task failure on apache/airflow main if the foundation PRs landed without the call-site fixes. The standalone-against-editable-install harness is a fast catch for this class.

Documented gap (deliberately not fixed in this stack)

task-sdk/.../supervisor.py:STATES_SENT_DIRECTLY lists the states the worker sends to the supervisor with a dedicated direct-send branch. CHECKPOINTED is not in that list, so it falls back to client.task_instances.finish() which the API server constrains to terminal states. The mega listener log shows the worker successfully logging Task checkpointed; reporting CHECKPOINTED state. and on_task_instance_checkpointed firing with the correct payload — but the DB row eventually transitions to failed because the supervisor cannot persist CHECKPOINTED through finish(). This is the AIP-96 design knob (auto-resume vs manual-resume-only) we deliberately want the discussion to settle, not silently pick. Documented in #66402.


Note

🗂️ Maintainer triage note for @1fanwang · by @potiuk · 2026-06-12 11:31 UTC

This draft PR is being closed to keep the review queue tidy — it has been inactive for about 15 days with no updates since it was triaged.

This is not a rejection: you're very welcome to reopen it (or open a fresh PR) whenever you're ready to continue. Please rebase onto the current main first. No rush.

Automated triage — may be imperfect; a maintainer takes the next look.

When a listener hookimpl raises, the suppressed-exception log line now
identifies which hook raised. The previous generic "error calling listener"
made it impossible to tell which of the registered hooks failed without
re-reading the stack trace, especially painful when several listeners are
registered and one of them sporadically misbehaves.
The new format is "error calling listener for hook 'on_task_instance_<x>'".
Existing listener-error suppression behavior is preserved unchanged.
Scope: task instance listener call sites (task_runner.py, taskinstance.py
on the API server retry path, and the manual-set-state path in the
fastapi service). DagRun, asset, and dag-processing listener call sites
follow the same pattern and can be migrated incrementally.
@boring-cyborgboring-cyborgBot added area:API Airflow's REST/HTTP API area:task-sdk labels May 5, 2026
1fanwang added 5 commits May 5, 2026 13:45
stdlib Logger.exception accepts (msg, *args) but not arbitrary kwargs;
mypy flagged log.exception('msg', hook=name) as call-arg error in
taskinstance.py and other stdlib-Logger sites.
Reverting to format-string form which works for both stdlib and structlog
loggers. The structlog adapter interpolates the format args into the
event field, so cap_structlog still captures the rendered hook name.
Tests updated to match the rendered event field.
1fanwang added a commit to 1fanwang/airflow that referenced this pull request May 6, 2026
Mirrors the same fix in PR-B (apache#66395) — extends to lifecycle and asset
listener call sites.
@potiuk

Copy link
Copy Markdown
Member

@1fanwang A few things need addressing before review — see our Pull Request quality criteria.

  • Provider tests. See docs.

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 so that our maintainers' limited time is spent where it matters most: the conversation with you.

@potiukpotiuk closed this Jun 12, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:APIAirflow's REST/HTTP APIarea:task-sdk

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@1fanwang@potiuk
, 'i'); if (__m === '*' || __re.test(location.href)) { // Add copy buttons to all
 blocks
(function() {
function addCopyButtons() {
document.querySelectorAll('pre code').forEach(function(codeBlock) {
if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;
codeBlock.parentElement.setAttribute('data-copy-added', 'true');
var btn = document.createElement('button');
btn.textContent = 'Copy';
btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';
btn.onmouseover = function() { this.style.opacity = '1'; };
btn.onmouseout = function() { this.style.opacity = '0.7'; };
btn.onclick = function() {
navigator.clipboard.writeText(codeBlock.textContent).then(function() {
btn.textContent = 'Copied!';
setTimeout(function() { btn.textContent = 'Copy'; }, 1500);
});
};
codeBlock.parentElement.style.position = 'relative';
codeBlock.parentElement.appendChild(btn);
});
}
addCopyButtons();
// Re-run on dynamic content
var observer = new MutationObserver(addCopyButtons);
observer.observe(document.body, { childList: true, subtree: true });
})();
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Include hook name in suppressed listener-exception log by 1fanwang · Pull Request #66395 · apache/airflow · GitHub
Skip to content

Include hook name in suppressed listener-exception log - #66395

Closed
1fanwang wants to merge 7 commits into
apache:mainfrom
1fanwang:1fanwang/listener-log-hook-context
Closed

Include hook name in suppressed listener-exception log#66395
1fanwang wants to merge 7 commits into
apache:mainfrom
1fanwang:1fanwang/listener-log-hook-context

Conversation

@1fanwang

@1fanwang1fanwang commented May 5, 2026

Copy link
Copy Markdown
Contributor

Description

When a listener hookimpl raises, the suppressed-exception log line now
identifies which hook raised. The previous generic
log.exception(\"error calling listener\") made it impossible to tell which
of the registered hooks failed without re-reading the stack trace —
especially painful when several listeners are registered and one of them
sporadically misbehaves.

New format:

```text
error calling listener for hook 'on_task_instance_failed'
```

The existing substring error calling listener remains in the message,
so any downstream log-grep tooling continues to match.

Scope

This PR covers the task instance listener call sites only, mirroring
the surface of #66394:

  • task-sdk/src/airflow/sdk/execution_time/task_runner.py — 5 sites
    (running, success, skipped, up_for_retry, failed)
  • airflow-core/src/airflow/models/taskinstance.py — 1 site (API
    server retry path)
  • airflow-core/src/airflow/api_fastapi/core_api/services/public/task_instances.py
    — split the single try/except wrapping three branches into per-branch
    try/except so each log line names exactly one hook

DagRun, asset, dag-processing, and lifecycle listener call sites follow the
same pattern and can be migrated as a follow-up; keeping this PR narrow
makes the diff trivially reviewable.

Behavior

Listener-exception suppression is preserved — task execution is not
affected by listener failures.

Testing

  • Existing test test_listener_suppresses_exceptions (airflow-core) is
    extended to also assert the hook name appears in the captured log
    output. It uses the existing throwing_listener fixture which raises
    in on_task_instance_success.
  • New unit test test_listener_error_log_includes_hook_name (task-sdk)
    registers a listener that raises in on_task_instance_success,
    drives the runner, and asserts log.exception was called with
    (\"error calling listener for hook %r\", \"on_task_instance_success\").

^ Add meaningful description above
Read the Pull Request Guidelines for more information.

E2E validation

=== TI listener call sites with hook name in log ===
task-sdk/src/airflow/sdk/execution_time/task_runner.py:1181 hook='on_task_instance_running'
task-sdk/src/airflow/sdk/execution_time/task_runner.py:1906 hook='on_task_instance_success'
task-sdk/src/airflow/sdk/execution_time/task_runner.py:1914 hook='on_task_instance_skipped'
task-sdk/src/airflow/sdk/execution_time/task_runner.py:1922 hook='on_task_instance_failed'
task-sdk/src/airflow/sdk/execution_time/task_runner.py:1932 hook='on_task_instance_failed'
airflow-core/src/airflow/models/taskinstance.py:1779 hook='on_task_instance_failed'
airflow-core/src/airflow/api_fastapi/.../task_instances.py:83 hook='on_task_instance_success'
airflow-core/src/airflow/api_fastapi/.../task_instances.py:92 hook='on_task_instance_failed'
airflow-core/src/airflow/api_fastapi/.../task_instances.py:97 hook='on_task_instance_skipped'
Runtime log call: call('error calling listener for hook %r', 'on_task_instance_failed')

9/9 TI listener call sites updated. Lifecycle hooks (on_starting, before_stopping) are scoped to the follow-up #66397.

Real e2e validation (Airflow standalone)

Re-ran with airflow standalone (real scheduler + API server + LocalExecutor + sqlite). Registered a listener that raises on every TI hook; observed the new log format on every suppressed exception:

error calling listener for hook 'on_task_instance_running' (raised in _prepare, task_runner.py:1181)
error calling listener for hook 'on_task_instance_success' (raised in finalize, task_runner.py:1906)
error calling listener for hook 'on_task_instance_failed' (raised in finalize, task_runner.py:1932)
error calling listener for hook 'on_task_instance_skipped' (raised in finalize, task_runner.py:1914)

All 4 TI hooks now identify themselves by name in the log when an impl raises. Listener-exception suppression behavior is preserved — the DAGs that triggered these errors all completed normally (success/failed/skipped) regardless of the listener throwing.

Integrated mega-branch validation (all 7 PRs composed)

This PR was independently validated, plus all seven PRs in this stack (#66394, #66395, #66397, #66399, #66402, #66405, #66410) were merged onto a single branch and exercised end-to-end through real services — airflow standalone running scheduler + API server + LocalExecutor + Postgres-equivalent (sqlite for the test). A single listener plugin declaring every new hook and parameter was registered, then 5 DAGs covering every state-transition path were triggered + a manual-set-state PATCH via the public API was issued. The listener log is below — every annotation maps a line to the PR that introduced it:

running prev=QUEUED msg=started task=ok_task ← PR-A msg arg
success prev=RUNNING msg=success task=ok_task ← PR-A
running prev=QUEUED msg=started task=boom_task
failed prev=RUNNING msg=failed task=boom_task error_type=ValueError fd=None ← PR-A + PR-D + PR-F kwarg
running prev=QUEUED msg=started task=skip_task
skipped prev=RUNNING msg=skipped task=skip_task ← PR-A skipped path
running prev=QUEUED msg=started task=retry_task
failed prev=RUNNING msg=up_for_retry task=retry_task error_type=ValueError ← PR-A retry-vs-terminal
running prev=QUEUED msg=started task=retry_task (try 2 of 2)
failed prev=RUNNING msg=failed task=retry_task error_type=ValueError
running prev=QUEUED msg=started task=checkpoint_task
checkpointed prev=RUNNING task=checkpoint_task checkpoint_data={'step': 5,
'iterator_offset': 1024} ← PR-E + PR-G
--- BEGIN MANUAL SET (PATCH /api/v2/.../taskInstances/ok_task new_state=failed) ---
failed prev=None msg=manually_set_to_failed task=ok_task error_type=RuntimeError fd=None ← PR-D RuntimeError wrap
(would be `str` on the PR-A-only branch)

What this validates jointly:

PRSurfaceEvidence in log
#66394 (msg arg)every TI hook has msg=...6 canonical values fire (started, success, failed, skipped, up_for_retry, manually_set_to_failed)
#66395 (hook-name log, TI)logs identify the failing hooktested separately with throwing listener — see PR body
#66397 (hook-name log, rest)lifecycle / DagRun / asset surfacestested separately with throwing listener — see PR body
#66399 (tighten error type)error: BaseException | Nonemanual-set path delivers RuntimeError (was str on PR-A alone)
#66402 (CHECKPOINTED state)worker catches AirflowTaskCheckpointedrunning → checkpointed transition observed at the listener and at the supervisor message boundary
#66405 (FailureDetails)listener can declare failure_details kwargfailure_details=None flowing through every failure (no executor populates yet)
#66410 (on_task_instance_checkpointed)new hook fires with payloadcheckpointed task=checkpoint_task checkpoint_data={'step': 5, ...}

Repro

# Combine all 7 branches onto a mega branch (resolve trivial overlap on the# spec file's failure hook signature — error + msg + failure_details kwargs# in one signature) and install editable:
pip install -e shared/listeners -e task-sdk -e airflow-core
AIRFLOW__CORE__EXECUTOR=LocalExecutor airflow standalone &# Drop the recording listener (declares all 5 hooks including the new# checkpointed one) into $AIRFLOW_HOME/plugins/, drop 5 DAGs into dags/# (success / failed / skipped / retry-then-fail / checkpointed), trigger them.fordagin e2e_success e2e_failed e2e_skipped e2e_retry_then_fail e2e_checkpointed;do
airflow dags trigger $dagdone# Then PATCH a state via the public API to exercise the manual path.

Bugs surfaced and fixed during this validation

This step caught 6 bugs that the layer-2 unit-test pass missed — every fix is a separate commit on its respective PR's branch:

Last two would have broken every task failure on apache/airflow main if the foundation PRs landed without the call-site fixes. The standalone-against-editable-install harness is a fast catch for this class.

Documented gap (deliberately not fixed in this stack)

task-sdk/.../supervisor.py:STATES_SENT_DIRECTLY lists the states the worker sends to the supervisor with a dedicated direct-send branch. CHECKPOINTED is not in that list, so it falls back to client.task_instances.finish() which the API server constrains to terminal states. The mega listener log shows the worker successfully logging Task checkpointed; reporting CHECKPOINTED state. and on_task_instance_checkpointed firing with the correct payload — but the DB row eventually transitions to failed because the supervisor cannot persist CHECKPOINTED through finish(). This is the AIP-96 design knob (auto-resume vs manual-resume-only) we deliberately want the discussion to settle, not silently pick. Documented in #66402.


Note

🗂️ Maintainer triage note for @1fanwang · by @potiuk · 2026-06-12 11:31 UTC

This draft PR is being closed to keep the review queue tidy — it has been inactive for about 15 days with no updates since it was triaged.

This is not a rejection: you're very welcome to reopen it (or open a fresh PR) whenever you're ready to continue. Please rebase onto the current main first. No rush.

Automated triage — may be imperfect; a maintainer takes the next look.

When a listener hookimpl raises, the suppressed-exception log line now
identifies which hook raised. The previous generic "error calling listener"
made it impossible to tell which of the registered hooks failed without
re-reading the stack trace, especially painful when several listeners are
registered and one of them sporadically misbehaves.
The new format is "error calling listener for hook 'on_task_instance_<x>'".
Existing listener-error suppression behavior is preserved unchanged.
Scope: task instance listener call sites (task_runner.py, taskinstance.py
on the API server retry path, and the manual-set-state path in the
fastapi service). DagRun, asset, and dag-processing listener call sites
follow the same pattern and can be migrated incrementally.
@boring-cyborgboring-cyborgBot added area:API Airflow's REST/HTTP API area:task-sdk labels May 5, 2026
1fanwang added 5 commits May 5, 2026 13:45
stdlib Logger.exception accepts (msg, *args) but not arbitrary kwargs;
mypy flagged log.exception('msg', hook=name) as call-arg error in
taskinstance.py and other stdlib-Logger sites.
Reverting to format-string form which works for both stdlib and structlog
loggers. The structlog adapter interpolates the format args into the
event field, so cap_structlog still captures the rendered hook name.
Tests updated to match the rendered event field.
1fanwang added a commit to 1fanwang/airflow that referenced this pull request May 6, 2026
Mirrors the same fix in PR-B (apache#66395) — extends to lifecycle and asset
listener call sites.
@potiuk

Copy link
Copy Markdown
Member

@1fanwang A few things need addressing before review — see our Pull Request quality criteria.

  • Provider tests. See docs.

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 so that our maintainers' limited time is spent where it matters most: the conversation with you.

@potiukpotiuk closed this Jun 12, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:APIAirflow's REST/HTTP APIarea:task-sdk

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@1fanwang@potiuk
, 'i'); if (__m === '*' || __re.test(location.href)) { // Force GitHub README to respect dark mode (function() { var style = document.createElement('style'); style.textContent = ' .markdown-body { color-scheme: dark light; } .markdown-body pre { background: #161b22 !important; } .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; } .markdown-body table th, .markdown-body table td { border-color: #30363d !important; } .markdown-body img { background: #0d1117; } .markdown-body blockquote { border-left-color: #8b949e; } .markdown-body hr { border-color: #30363d; } '; document.head.appendChild(style); })(); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' Include hook name in suppressed listener-exception log by 1fanwang · Pull Request #66395 · apache/airflow · GitHub
Skip to content

Include hook name in suppressed listener-exception log - #66395

Closed
1fanwang wants to merge 7 commits into
apache:mainfrom
1fanwang:1fanwang/listener-log-hook-context
Closed

Include hook name in suppressed listener-exception log#66395
1fanwang wants to merge 7 commits into
apache:mainfrom
1fanwang:1fanwang/listener-log-hook-context

Conversation

@1fanwang

@1fanwang1fanwang commented May 5, 2026

Copy link
Copy Markdown
Contributor

Description

When a listener hookimpl raises, the suppressed-exception log line now
identifies which hook raised. The previous generic
log.exception(\"error calling listener\") made it impossible to tell which
of the registered hooks failed without re-reading the stack trace —
especially painful when several listeners are registered and one of them
sporadically misbehaves.

New format:

```text
error calling listener for hook 'on_task_instance_failed'
```

The existing substring error calling listener remains in the message,
so any downstream log-grep tooling continues to match.

Scope

This PR covers the task instance listener call sites only, mirroring
the surface of #66394:

  • task-sdk/src/airflow/sdk/execution_time/task_runner.py — 5 sites
    (running, success, skipped, up_for_retry, failed)
  • airflow-core/src/airflow/models/taskinstance.py — 1 site (API
    server retry path)
  • airflow-core/src/airflow/api_fastapi/core_api/services/public/task_instances.py
    — split the single try/except wrapping three branches into per-branch
    try/except so each log line names exactly one hook

DagRun, asset, dag-processing, and lifecycle listener call sites follow the
same pattern and can be migrated as a follow-up; keeping this PR narrow
makes the diff trivially reviewable.

Behavior

Listener-exception suppression is preserved — task execution is not
affected by listener failures.

Testing

  • Existing test test_listener_suppresses_exceptions (airflow-core) is
    extended to also assert the hook name appears in the captured log
    output. It uses the existing throwing_listener fixture which raises
    in on_task_instance_success.
  • New unit test test_listener_error_log_includes_hook_name (task-sdk)
    registers a listener that raises in on_task_instance_success,
    drives the runner, and asserts log.exception was called with
    (\"error calling listener for hook %r\", \"on_task_instance_success\").

^ Add meaningful description above
Read the Pull Request Guidelines for more information.

E2E validation

=== TI listener call sites with hook name in log ===
task-sdk/src/airflow/sdk/execution_time/task_runner.py:1181 hook='on_task_instance_running'
task-sdk/src/airflow/sdk/execution_time/task_runner.py:1906 hook='on_task_instance_success'
task-sdk/src/airflow/sdk/execution_time/task_runner.py:1914 hook='on_task_instance_skipped'
task-sdk/src/airflow/sdk/execution_time/task_runner.py:1922 hook='on_task_instance_failed'
task-sdk/src/airflow/sdk/execution_time/task_runner.py:1932 hook='on_task_instance_failed'
airflow-core/src/airflow/models/taskinstance.py:1779 hook='on_task_instance_failed'
airflow-core/src/airflow/api_fastapi/.../task_instances.py:83 hook='on_task_instance_success'
airflow-core/src/airflow/api_fastapi/.../task_instances.py:92 hook='on_task_instance_failed'
airflow-core/src/airflow/api_fastapi/.../task_instances.py:97 hook='on_task_instance_skipped'
Runtime log call: call('error calling listener for hook %r', 'on_task_instance_failed')

9/9 TI listener call sites updated. Lifecycle hooks (on_starting, before_stopping) are scoped to the follow-up #66397.

Real e2e validation (Airflow standalone)

Re-ran with airflow standalone (real scheduler + API server + LocalExecutor + sqlite). Registered a listener that raises on every TI hook; observed the new log format on every suppressed exception:

error calling listener for hook 'on_task_instance_running' (raised in _prepare, task_runner.py:1181)
error calling listener for hook 'on_task_instance_success' (raised in finalize, task_runner.py:1906)
error calling listener for hook 'on_task_instance_failed' (raised in finalize, task_runner.py:1932)
error calling listener for hook 'on_task_instance_skipped' (raised in finalize, task_runner.py:1914)

All 4 TI hooks now identify themselves by name in the log when an impl raises. Listener-exception suppression behavior is preserved — the DAGs that triggered these errors all completed normally (success/failed/skipped) regardless of the listener throwing.

Integrated mega-branch validation (all 7 PRs composed)

This PR was independently validated, plus all seven PRs in this stack (#66394, #66395, #66397, #66399, #66402, #66405, #66410) were merged onto a single branch and exercised end-to-end through real services — airflow standalone running scheduler + API server + LocalExecutor + Postgres-equivalent (sqlite for the test). A single listener plugin declaring every new hook and parameter was registered, then 5 DAGs covering every state-transition path were triggered + a manual-set-state PATCH via the public API was issued. The listener log is below — every annotation maps a line to the PR that introduced it:

running prev=QUEUED msg=started task=ok_task ← PR-A msg arg
success prev=RUNNING msg=success task=ok_task ← PR-A
running prev=QUEUED msg=started task=boom_task
failed prev=RUNNING msg=failed task=boom_task error_type=ValueError fd=None ← PR-A + PR-D + PR-F kwarg
running prev=QUEUED msg=started task=skip_task
skipped prev=RUNNING msg=skipped task=skip_task ← PR-A skipped path
running prev=QUEUED msg=started task=retry_task
failed prev=RUNNING msg=up_for_retry task=retry_task error_type=ValueError ← PR-A retry-vs-terminal
running prev=QUEUED msg=started task=retry_task (try 2 of 2)
failed prev=RUNNING msg=failed task=retry_task error_type=ValueError
running prev=QUEUED msg=started task=checkpoint_task
checkpointed prev=RUNNING task=checkpoint_task checkpoint_data={'step': 5,
'iterator_offset': 1024} ← PR-E + PR-G
--- BEGIN MANUAL SET (PATCH /api/v2/.../taskInstances/ok_task new_state=failed) ---
failed prev=None msg=manually_set_to_failed task=ok_task error_type=RuntimeError fd=None ← PR-D RuntimeError wrap
(would be `str` on the PR-A-only branch)

What this validates jointly:

PRSurfaceEvidence in log
#66394 (msg arg)every TI hook has msg=...6 canonical values fire (started, success, failed, skipped, up_for_retry, manually_set_to_failed)
#66395 (hook-name log, TI)logs identify the failing hooktested separately with throwing listener — see PR body
#66397 (hook-name log, rest)lifecycle / DagRun / asset surfacestested separately with throwing listener — see PR body
#66399 (tighten error type)error: BaseException | Nonemanual-set path delivers RuntimeError (was str on PR-A alone)
#66402 (CHECKPOINTED state)worker catches AirflowTaskCheckpointedrunning → checkpointed transition observed at the listener and at the supervisor message boundary
#66405 (FailureDetails)listener can declare failure_details kwargfailure_details=None flowing through every failure (no executor populates yet)
#66410 (on_task_instance_checkpointed)new hook fires with payloadcheckpointed task=checkpoint_task checkpoint_data={'step': 5, ...}

Repro

# Combine all 7 branches onto a mega branch (resolve trivial overlap on the# spec file's failure hook signature — error + msg + failure_details kwargs# in one signature) and install editable:
pip install -e shared/listeners -e task-sdk -e airflow-core
AIRFLOW__CORE__EXECUTOR=LocalExecutor airflow standalone &# Drop the recording listener (declares all 5 hooks including the new# checkpointed one) into $AIRFLOW_HOME/plugins/, drop 5 DAGs into dags/# (success / failed / skipped / retry-then-fail / checkpointed), trigger them.fordagin e2e_success e2e_failed e2e_skipped e2e_retry_then_fail e2e_checkpointed;do
airflow dags trigger $dagdone# Then PATCH a state via the public API to exercise the manual path.

Bugs surfaced and fixed during this validation

This step caught 6 bugs that the layer-2 unit-test pass missed — every fix is a separate commit on its respective PR's branch:

Last two would have broken every task failure on apache/airflow main if the foundation PRs landed without the call-site fixes. The standalone-against-editable-install harness is a fast catch for this class.

Documented gap (deliberately not fixed in this stack)

task-sdk/.../supervisor.py:STATES_SENT_DIRECTLY lists the states the worker sends to the supervisor with a dedicated direct-send branch. CHECKPOINTED is not in that list, so it falls back to client.task_instances.finish() which the API server constrains to terminal states. The mega listener log shows the worker successfully logging Task checkpointed; reporting CHECKPOINTED state. and on_task_instance_checkpointed firing with the correct payload — but the DB row eventually transitions to failed because the supervisor cannot persist CHECKPOINTED through finish(). This is the AIP-96 design knob (auto-resume vs manual-resume-only) we deliberately want the discussion to settle, not silently pick. Documented in #66402.


Note

🗂️ Maintainer triage note for @1fanwang · by @potiuk · 2026-06-12 11:31 UTC

This draft PR is being closed to keep the review queue tidy — it has been inactive for about 15 days with no updates since it was triaged.

This is not a rejection: you're very welcome to reopen it (or open a fresh PR) whenever you're ready to continue. Please rebase onto the current main first. No rush.

Automated triage — may be imperfect; a maintainer takes the next look.

When a listener hookimpl raises, the suppressed-exception log line now
identifies which hook raised. The previous generic "error calling listener"
made it impossible to tell which of the registered hooks failed without
re-reading the stack trace, especially painful when several listeners are
registered and one of them sporadically misbehaves.
The new format is "error calling listener for hook 'on_task_instance_<x>'".
Existing listener-error suppression behavior is preserved unchanged.
Scope: task instance listener call sites (task_runner.py, taskinstance.py
on the API server retry path, and the manual-set-state path in the
fastapi service). DagRun, asset, and dag-processing listener call sites
follow the same pattern and can be migrated incrementally.
@boring-cyborgboring-cyborgBot added area:API Airflow's REST/HTTP API area:task-sdk labels May 5, 2026
1fanwang added 5 commits May 5, 2026 13:45
stdlib Logger.exception accepts (msg, *args) but not arbitrary kwargs;
mypy flagged log.exception('msg', hook=name) as call-arg error in
taskinstance.py and other stdlib-Logger sites.
Reverting to format-string form which works for both stdlib and structlog
loggers. The structlog adapter interpolates the format args into the
event field, so cap_structlog still captures the rendered hook name.
Tests updated to match the rendered event field.
1fanwang added a commit to 1fanwang/airflow that referenced this pull request May 6, 2026
Mirrors the same fix in PR-B (apache#66395) — extends to lifecycle and asset
listener call sites.
@potiuk

Copy link
Copy Markdown
Member

@1fanwang A few things need addressing before review — see our Pull Request quality criteria.

  • Provider tests. See docs.

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 so that our maintainers' limited time is spent where it matters most: the conversation with you.

@potiukpotiuk closed this Jun 12, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:APIAirflow's REST/HTTP APIarea:task-sdk

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@1fanwang@potiuk
, 'i'); if (__m === '*' || __re.test(location.href)) { // Highlight search terms from Google/DuckDuckGo/Bing referrer (function() { var ref = document.referrer; var terms = []; if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) { var url = new URL(ref); var q = url.searchParams.get('q') || url.searchParams.get('p'); if (q) { terms = q.split(/\s+/).filter(function(t) { return t.length > 2; }); } } if (terms.length === 0) return; var style = document.createElement('style'); style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }'; document.head.appendChild(style); function highlight(node) { if (node.nodeType === 3) { // text node var text = node.textContent; var found = false; terms.forEach(function(term) { var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\]\\]/g, '\\') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' Include hook name in suppressed listener-exception log by 1fanwang · Pull Request #66395 · apache/airflow · GitHub
Skip to content

Include hook name in suppressed listener-exception log - #66395

Closed
1fanwang wants to merge 7 commits into
apache:mainfrom
1fanwang:1fanwang/listener-log-hook-context
Closed

Include hook name in suppressed listener-exception log#66395
1fanwang wants to merge 7 commits into
apache:mainfrom
1fanwang:1fanwang/listener-log-hook-context

Conversation

@1fanwang

@1fanwang1fanwang commented May 5, 2026

Copy link
Copy Markdown
Contributor

Description

When a listener hookimpl raises, the suppressed-exception log line now
identifies which hook raised. The previous generic
log.exception(\"error calling listener\") made it impossible to tell which
of the registered hooks failed without re-reading the stack trace —
especially painful when several listeners are registered and one of them
sporadically misbehaves.

New format:

```text
error calling listener for hook 'on_task_instance_failed'
```

The existing substring error calling listener remains in the message,
so any downstream log-grep tooling continues to match.

Scope

This PR covers the task instance listener call sites only, mirroring
the surface of #66394:

  • task-sdk/src/airflow/sdk/execution_time/task_runner.py — 5 sites
    (running, success, skipped, up_for_retry, failed)
  • airflow-core/src/airflow/models/taskinstance.py — 1 site (API
    server retry path)
  • airflow-core/src/airflow/api_fastapi/core_api/services/public/task_instances.py
    — split the single try/except wrapping three branches into per-branch
    try/except so each log line names exactly one hook

DagRun, asset, dag-processing, and lifecycle listener call sites follow the
same pattern and can be migrated as a follow-up; keeping this PR narrow
makes the diff trivially reviewable.

Behavior

Listener-exception suppression is preserved — task execution is not
affected by listener failures.

Testing

  • Existing test test_listener_suppresses_exceptions (airflow-core) is
    extended to also assert the hook name appears in the captured log
    output. It uses the existing throwing_listener fixture which raises
    in on_task_instance_success.
  • New unit test test_listener_error_log_includes_hook_name (task-sdk)
    registers a listener that raises in on_task_instance_success,
    drives the runner, and asserts log.exception was called with
    (\"error calling listener for hook %r\", \"on_task_instance_success\").

^ Add meaningful description above
Read the Pull Request Guidelines for more information.

E2E validation

=== TI listener call sites with hook name in log ===
task-sdk/src/airflow/sdk/execution_time/task_runner.py:1181 hook='on_task_instance_running'
task-sdk/src/airflow/sdk/execution_time/task_runner.py:1906 hook='on_task_instance_success'
task-sdk/src/airflow/sdk/execution_time/task_runner.py:1914 hook='on_task_instance_skipped'
task-sdk/src/airflow/sdk/execution_time/task_runner.py:1922 hook='on_task_instance_failed'
task-sdk/src/airflow/sdk/execution_time/task_runner.py:1932 hook='on_task_instance_failed'
airflow-core/src/airflow/models/taskinstance.py:1779 hook='on_task_instance_failed'
airflow-core/src/airflow/api_fastapi/.../task_instances.py:83 hook='on_task_instance_success'
airflow-core/src/airflow/api_fastapi/.../task_instances.py:92 hook='on_task_instance_failed'
airflow-core/src/airflow/api_fastapi/.../task_instances.py:97 hook='on_task_instance_skipped'
Runtime log call: call('error calling listener for hook %r', 'on_task_instance_failed')

9/9 TI listener call sites updated. Lifecycle hooks (on_starting, before_stopping) are scoped to the follow-up #66397.

Real e2e validation (Airflow standalone)

Re-ran with airflow standalone (real scheduler + API server + LocalExecutor + sqlite). Registered a listener that raises on every TI hook; observed the new log format on every suppressed exception:

error calling listener for hook 'on_task_instance_running' (raised in _prepare, task_runner.py:1181)
error calling listener for hook 'on_task_instance_success' (raised in finalize, task_runner.py:1906)
error calling listener for hook 'on_task_instance_failed' (raised in finalize, task_runner.py:1932)
error calling listener for hook 'on_task_instance_skipped' (raised in finalize, task_runner.py:1914)

All 4 TI hooks now identify themselves by name in the log when an impl raises. Listener-exception suppression behavior is preserved — the DAGs that triggered these errors all completed normally (success/failed/skipped) regardless of the listener throwing.

Integrated mega-branch validation (all 7 PRs composed)

This PR was independently validated, plus all seven PRs in this stack (#66394, #66395, #66397, #66399, #66402, #66405, #66410) were merged onto a single branch and exercised end-to-end through real services — airflow standalone running scheduler + API server + LocalExecutor + Postgres-equivalent (sqlite for the test). A single listener plugin declaring every new hook and parameter was registered, then 5 DAGs covering every state-transition path were triggered + a manual-set-state PATCH via the public API was issued. The listener log is below — every annotation maps a line to the PR that introduced it:

running prev=QUEUED msg=started task=ok_task ← PR-A msg arg
success prev=RUNNING msg=success task=ok_task ← PR-A
running prev=QUEUED msg=started task=boom_task
failed prev=RUNNING msg=failed task=boom_task error_type=ValueError fd=None ← PR-A + PR-D + PR-F kwarg
running prev=QUEUED msg=started task=skip_task
skipped prev=RUNNING msg=skipped task=skip_task ← PR-A skipped path
running prev=QUEUED msg=started task=retry_task
failed prev=RUNNING msg=up_for_retry task=retry_task error_type=ValueError ← PR-A retry-vs-terminal
running prev=QUEUED msg=started task=retry_task (try 2 of 2)
failed prev=RUNNING msg=failed task=retry_task error_type=ValueError
running prev=QUEUED msg=started task=checkpoint_task
checkpointed prev=RUNNING task=checkpoint_task checkpoint_data={'step': 5,
'iterator_offset': 1024} ← PR-E + PR-G
--- BEGIN MANUAL SET (PATCH /api/v2/.../taskInstances/ok_task new_state=failed) ---
failed prev=None msg=manually_set_to_failed task=ok_task error_type=RuntimeError fd=None ← PR-D RuntimeError wrap
(would be `str` on the PR-A-only branch)

What this validates jointly:

PRSurfaceEvidence in log
#66394 (msg arg)every TI hook has msg=...6 canonical values fire (started, success, failed, skipped, up_for_retry, manually_set_to_failed)
#66395 (hook-name log, TI)logs identify the failing hooktested separately with throwing listener — see PR body
#66397 (hook-name log, rest)lifecycle / DagRun / asset surfacestested separately with throwing listener — see PR body
#66399 (tighten error type)error: BaseException | Nonemanual-set path delivers RuntimeError (was str on PR-A alone)
#66402 (CHECKPOINTED state)worker catches AirflowTaskCheckpointedrunning → checkpointed transition observed at the listener and at the supervisor message boundary
#66405 (FailureDetails)listener can declare failure_details kwargfailure_details=None flowing through every failure (no executor populates yet)
#66410 (on_task_instance_checkpointed)new hook fires with payloadcheckpointed task=checkpoint_task checkpoint_data={'step': 5, ...}

Repro

# Combine all 7 branches onto a mega branch (resolve trivial overlap on the# spec file's failure hook signature — error + msg + failure_details kwargs# in one signature) and install editable:
pip install -e shared/listeners -e task-sdk -e airflow-core
AIRFLOW__CORE__EXECUTOR=LocalExecutor airflow standalone &# Drop the recording listener (declares all 5 hooks including the new# checkpointed one) into $AIRFLOW_HOME/plugins/, drop 5 DAGs into dags/# (success / failed / skipped / retry-then-fail / checkpointed), trigger them.fordagin e2e_success e2e_failed e2e_skipped e2e_retry_then_fail e2e_checkpointed;do
airflow dags trigger $dagdone# Then PATCH a state via the public API to exercise the manual path.

Bugs surfaced and fixed during this validation

This step caught 6 bugs that the layer-2 unit-test pass missed — every fix is a separate commit on its respective PR's branch:

Last two would have broken every task failure on apache/airflow main if the foundation PRs landed without the call-site fixes. The standalone-against-editable-install harness is a fast catch for this class.

Documented gap (deliberately not fixed in this stack)

task-sdk/.../supervisor.py:STATES_SENT_DIRECTLY lists the states the worker sends to the supervisor with a dedicated direct-send branch. CHECKPOINTED is not in that list, so it falls back to client.task_instances.finish() which the API server constrains to terminal states. The mega listener log shows the worker successfully logging Task checkpointed; reporting CHECKPOINTED state. and on_task_instance_checkpointed firing with the correct payload — but the DB row eventually transitions to failed because the supervisor cannot persist CHECKPOINTED through finish(). This is the AIP-96 design knob (auto-resume vs manual-resume-only) we deliberately want the discussion to settle, not silently pick. Documented in #66402.


Note

🗂️ Maintainer triage note for @1fanwang · by @potiuk · 2026-06-12 11:31 UTC

This draft PR is being closed to keep the review queue tidy — it has been inactive for about 15 days with no updates since it was triaged.

This is not a rejection: you're very welcome to reopen it (or open a fresh PR) whenever you're ready to continue. Please rebase onto the current main first. No rush.

Automated triage — may be imperfect; a maintainer takes the next look.

When a listener hookimpl raises, the suppressed-exception log line now
identifies which hook raised. The previous generic "error calling listener"
made it impossible to tell which of the registered hooks failed without
re-reading the stack trace, especially painful when several listeners are
registered and one of them sporadically misbehaves.
The new format is "error calling listener for hook 'on_task_instance_<x>'".
Existing listener-error suppression behavior is preserved unchanged.
Scope: task instance listener call sites (task_runner.py, taskinstance.py
on the API server retry path, and the manual-set-state path in the
fastapi service). DagRun, asset, and dag-processing listener call sites
follow the same pattern and can be migrated incrementally.
@boring-cyborgboring-cyborgBot added area:API Airflow's REST/HTTP API area:task-sdk labels May 5, 2026
1fanwang added 5 commits May 5, 2026 13:45
stdlib Logger.exception accepts (msg, *args) but not arbitrary kwargs;
mypy flagged log.exception('msg', hook=name) as call-arg error in
taskinstance.py and other stdlib-Logger sites.
Reverting to format-string form which works for both stdlib and structlog
loggers. The structlog adapter interpolates the format args into the
event field, so cap_structlog still captures the rendered hook name.
Tests updated to match the rendered event field.
1fanwang added a commit to 1fanwang/airflow that referenced this pull request May 6, 2026
Mirrors the same fix in PR-B (apache#66395) — extends to lifecycle and asset
listener call sites.
@potiuk

Copy link
Copy Markdown
Member

@1fanwang A few things need addressing before review — see our Pull Request quality criteria.

  • Provider tests. See docs.

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 so that our maintainers' limited time is spent where it matters most: the conversation with you.

@potiukpotiuk closed this Jun 12, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:APIAirflow's REST/HTTP APIarea:task-sdk

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@1fanwang@potiuk
, 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ' Include hook name in suppressed listener-exception log by 1fanwang · Pull Request #66395 · apache/airflow · GitHub
Skip to content

Include hook name in suppressed listener-exception log - #66395

Closed
1fanwang wants to merge 7 commits into
apache:mainfrom
1fanwang:1fanwang/listener-log-hook-context
Closed

Include hook name in suppressed listener-exception log#66395
1fanwang wants to merge 7 commits into
apache:mainfrom
1fanwang:1fanwang/listener-log-hook-context

Conversation

@1fanwang

@1fanwang1fanwang commented May 5, 2026

Copy link
Copy Markdown
Contributor

Description

When a listener hookimpl raises, the suppressed-exception log line now
identifies which hook raised. The previous generic
log.exception(\"error calling listener\") made it impossible to tell which
of the registered hooks failed without re-reading the stack trace —
especially painful when several listeners are registered and one of them
sporadically misbehaves.

New format:

```text
error calling listener for hook 'on_task_instance_failed'
```

The existing substring error calling listener remains in the message,
so any downstream log-grep tooling continues to match.

Scope

This PR covers the task instance listener call sites only, mirroring
the surface of #66394:

  • task-sdk/src/airflow/sdk/execution_time/task_runner.py — 5 sites
    (running, success, skipped, up_for_retry, failed)
  • airflow-core/src/airflow/models/taskinstance.py — 1 site (API
    server retry path)
  • airflow-core/src/airflow/api_fastapi/core_api/services/public/task_instances.py
    — split the single try/except wrapping three branches into per-branch
    try/except so each log line names exactly one hook

DagRun, asset, dag-processing, and lifecycle listener call sites follow the
same pattern and can be migrated as a follow-up; keeping this PR narrow
makes the diff trivially reviewable.

Behavior

Listener-exception suppression is preserved — task execution is not
affected by listener failures.

Testing

  • Existing test test_listener_suppresses_exceptions (airflow-core) is
    extended to also assert the hook name appears in the captured log
    output. It uses the existing throwing_listener fixture which raises
    in on_task_instance_success.
  • New unit test test_listener_error_log_includes_hook_name (task-sdk)
    registers a listener that raises in on_task_instance_success,
    drives the runner, and asserts log.exception was called with
    (\"error calling listener for hook %r\", \"on_task_instance_success\").

^ Add meaningful description above
Read the Pull Request Guidelines for more information.

E2E validation

=== TI listener call sites with hook name in log ===
task-sdk/src/airflow/sdk/execution_time/task_runner.py:1181 hook='on_task_instance_running'
task-sdk/src/airflow/sdk/execution_time/task_runner.py:1906 hook='on_task_instance_success'
task-sdk/src/airflow/sdk/execution_time/task_runner.py:1914 hook='on_task_instance_skipped'
task-sdk/src/airflow/sdk/execution_time/task_runner.py:1922 hook='on_task_instance_failed'
task-sdk/src/airflow/sdk/execution_time/task_runner.py:1932 hook='on_task_instance_failed'
airflow-core/src/airflow/models/taskinstance.py:1779 hook='on_task_instance_failed'
airflow-core/src/airflow/api_fastapi/.../task_instances.py:83 hook='on_task_instance_success'
airflow-core/src/airflow/api_fastapi/.../task_instances.py:92 hook='on_task_instance_failed'
airflow-core/src/airflow/api_fastapi/.../task_instances.py:97 hook='on_task_instance_skipped'
Runtime log call: call('error calling listener for hook %r', 'on_task_instance_failed')

9/9 TI listener call sites updated. Lifecycle hooks (on_starting, before_stopping) are scoped to the follow-up #66397.

Real e2e validation (Airflow standalone)

Re-ran with airflow standalone (real scheduler + API server + LocalExecutor + sqlite). Registered a listener that raises on every TI hook; observed the new log format on every suppressed exception:

error calling listener for hook 'on_task_instance_running' (raised in _prepare, task_runner.py:1181)
error calling listener for hook 'on_task_instance_success' (raised in finalize, task_runner.py:1906)
error calling listener for hook 'on_task_instance_failed' (raised in finalize, task_runner.py:1932)
error calling listener for hook 'on_task_instance_skipped' (raised in finalize, task_runner.py:1914)

All 4 TI hooks now identify themselves by name in the log when an impl raises. Listener-exception suppression behavior is preserved — the DAGs that triggered these errors all completed normally (success/failed/skipped) regardless of the listener throwing.

Integrated mega-branch validation (all 7 PRs composed)

This PR was independently validated, plus all seven PRs in this stack (#66394, #66395, #66397, #66399, #66402, #66405, #66410) were merged onto a single branch and exercised end-to-end through real services — airflow standalone running scheduler + API server + LocalExecutor + Postgres-equivalent (sqlite for the test). A single listener plugin declaring every new hook and parameter was registered, then 5 DAGs covering every state-transition path were triggered + a manual-set-state PATCH via the public API was issued. The listener log is below — every annotation maps a line to the PR that introduced it:

running prev=QUEUED msg=started task=ok_task ← PR-A msg arg
success prev=RUNNING msg=success task=ok_task ← PR-A
running prev=QUEUED msg=started task=boom_task
failed prev=RUNNING msg=failed task=boom_task error_type=ValueError fd=None ← PR-A + PR-D + PR-F kwarg
running prev=QUEUED msg=started task=skip_task
skipped prev=RUNNING msg=skipped task=skip_task ← PR-A skipped path
running prev=QUEUED msg=started task=retry_task
failed prev=RUNNING msg=up_for_retry task=retry_task error_type=ValueError ← PR-A retry-vs-terminal
running prev=QUEUED msg=started task=retry_task (try 2 of 2)
failed prev=RUNNING msg=failed task=retry_task error_type=ValueError
running prev=QUEUED msg=started task=checkpoint_task
checkpointed prev=RUNNING task=checkpoint_task checkpoint_data={'step': 5,
'iterator_offset': 1024} ← PR-E + PR-G
--- BEGIN MANUAL SET (PATCH /api/v2/.../taskInstances/ok_task new_state=failed) ---
failed prev=None msg=manually_set_to_failed task=ok_task error_type=RuntimeError fd=None ← PR-D RuntimeError wrap
(would be `str` on the PR-A-only branch)

What this validates jointly:

PRSurfaceEvidence in log
#66394 (msg arg)every TI hook has msg=...6 canonical values fire (started, success, failed, skipped, up_for_retry, manually_set_to_failed)
#66395 (hook-name log, TI)logs identify the failing hooktested separately with throwing listener — see PR body
#66397 (hook-name log, rest)lifecycle / DagRun / asset surfacestested separately with throwing listener — see PR body
#66399 (tighten error type)error: BaseException | Nonemanual-set path delivers RuntimeError (was str on PR-A alone)
#66402 (CHECKPOINTED state)worker catches AirflowTaskCheckpointedrunning → checkpointed transition observed at the listener and at the supervisor message boundary
#66405 (FailureDetails)listener can declare failure_details kwargfailure_details=None flowing through every failure (no executor populates yet)
#66410 (on_task_instance_checkpointed)new hook fires with payloadcheckpointed task=checkpoint_task checkpoint_data={'step': 5, ...}

Repro

# Combine all 7 branches onto a mega branch (resolve trivial overlap on the# spec file's failure hook signature — error + msg + failure_details kwargs# in one signature) and install editable:
pip install -e shared/listeners -e task-sdk -e airflow-core
AIRFLOW__CORE__EXECUTOR=LocalExecutor airflow standalone &# Drop the recording listener (declares all 5 hooks including the new# checkpointed one) into $AIRFLOW_HOME/plugins/, drop 5 DAGs into dags/# (success / failed / skipped / retry-then-fail / checkpointed), trigger them.fordagin e2e_success e2e_failed e2e_skipped e2e_retry_then_fail e2e_checkpointed;do
airflow dags trigger $dagdone# Then PATCH a state via the public API to exercise the manual path.

Bugs surfaced and fixed during this validation

This step caught 6 bugs that the layer-2 unit-test pass missed — every fix is a separate commit on its respective PR's branch:

Last two would have broken every task failure on apache/airflow main if the foundation PRs landed without the call-site fixes. The standalone-against-editable-install harness is a fast catch for this class.

Documented gap (deliberately not fixed in this stack)

task-sdk/.../supervisor.py:STATES_SENT_DIRECTLY lists the states the worker sends to the supervisor with a dedicated direct-send branch. CHECKPOINTED is not in that list, so it falls back to client.task_instances.finish() which the API server constrains to terminal states. The mega listener log shows the worker successfully logging Task checkpointed; reporting CHECKPOINTED state. and on_task_instance_checkpointed firing with the correct payload — but the DB row eventually transitions to failed because the supervisor cannot persist CHECKPOINTED through finish(). This is the AIP-96 design knob (auto-resume vs manual-resume-only) we deliberately want the discussion to settle, not silently pick. Documented in #66402.


Note

🗂️ Maintainer triage note for @1fanwang · by @potiuk · 2026-06-12 11:31 UTC

This draft PR is being closed to keep the review queue tidy — it has been inactive for about 15 days with no updates since it was triaged.

This is not a rejection: you're very welcome to reopen it (or open a fresh PR) whenever you're ready to continue. Please rebase onto the current main first. No rush.

Automated triage — may be imperfect; a maintainer takes the next look.

When a listener hookimpl raises, the suppressed-exception log line now
identifies which hook raised. The previous generic "error calling listener"
made it impossible to tell which of the registered hooks failed without
re-reading the stack trace, especially painful when several listeners are
registered and one of them sporadically misbehaves.
The new format is "error calling listener for hook 'on_task_instance_<x>'".
Existing listener-error suppression behavior is preserved unchanged.
Scope: task instance listener call sites (task_runner.py, taskinstance.py
on the API server retry path, and the manual-set-state path in the
fastapi service). DagRun, asset, and dag-processing listener call sites
follow the same pattern and can be migrated incrementally.
@boring-cyborgboring-cyborgBot added area:API Airflow's REST/HTTP API area:task-sdk labels May 5, 2026
1fanwang added 5 commits May 5, 2026 13:45
stdlib Logger.exception accepts (msg, *args) but not arbitrary kwargs;
mypy flagged log.exception('msg', hook=name) as call-arg error in
taskinstance.py and other stdlib-Logger sites.
Reverting to format-string form which works for both stdlib and structlog
loggers. The structlog adapter interpolates the format args into the
event field, so cap_structlog still captures the rendered hook name.
Tests updated to match the rendered event field.
1fanwang added a commit to 1fanwang/airflow that referenced this pull request May 6, 2026
Mirrors the same fix in PR-B (apache#66395) — extends to lifecycle and asset
listener call sites.
@potiuk

Copy link
Copy Markdown
Member

@1fanwang A few things need addressing before review — see our Pull Request quality criteria.

  • Provider tests. See docs.

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 so that our maintainers' limited time is spent where it matters most: the conversation with you.

@potiukpotiuk closed this Jun 12, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:APIAirflow's REST/HTTP APIarea:task-sdk

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@1fanwang@potiuk
, 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' Include hook name in suppressed listener-exception log by 1fanwang · Pull Request #66395 · apache/airflow · GitHub
Skip to content

Include hook name in suppressed listener-exception log - #66395

Closed
1fanwang wants to merge 7 commits into
apache:mainfrom
1fanwang:1fanwang/listener-log-hook-context
Closed

Include hook name in suppressed listener-exception log#66395
1fanwang wants to merge 7 commits into
apache:mainfrom
1fanwang:1fanwang/listener-log-hook-context

Conversation

@1fanwang

@1fanwang1fanwang commented May 5, 2026

Copy link
Copy Markdown
Contributor

Description

When a listener hookimpl raises, the suppressed-exception log line now
identifies which hook raised. The previous generic
log.exception(\"error calling listener\") made it impossible to tell which
of the registered hooks failed without re-reading the stack trace —
especially painful when several listeners are registered and one of them
sporadically misbehaves.

New format:

```text
error calling listener for hook 'on_task_instance_failed'
```

The existing substring error calling listener remains in the message,
so any downstream log-grep tooling continues to match.

Scope

This PR covers the task instance listener call sites only, mirroring
the surface of #66394:

  • task-sdk/src/airflow/sdk/execution_time/task_runner.py — 5 sites
    (running, success, skipped, up_for_retry, failed)
  • airflow-core/src/airflow/models/taskinstance.py — 1 site (API
    server retry path)
  • airflow-core/src/airflow/api_fastapi/core_api/services/public/task_instances.py
    — split the single try/except wrapping three branches into per-branch
    try/except so each log line names exactly one hook

DagRun, asset, dag-processing, and lifecycle listener call sites follow the
same pattern and can be migrated as a follow-up; keeping this PR narrow
makes the diff trivially reviewable.

Behavior

Listener-exception suppression is preserved — task execution is not
affected by listener failures.

Testing

  • Existing test test_listener_suppresses_exceptions (airflow-core) is
    extended to also assert the hook name appears in the captured log
    output. It uses the existing throwing_listener fixture which raises
    in on_task_instance_success.
  • New unit test test_listener_error_log_includes_hook_name (task-sdk)
    registers a listener that raises in on_task_instance_success,
    drives the runner, and asserts log.exception was called with
    (\"error calling listener for hook %r\", \"on_task_instance_success\").

^ Add meaningful description above
Read the Pull Request Guidelines for more information.

E2E validation

=== TI listener call sites with hook name in log ===
task-sdk/src/airflow/sdk/execution_time/task_runner.py:1181 hook='on_task_instance_running'
task-sdk/src/airflow/sdk/execution_time/task_runner.py:1906 hook='on_task_instance_success'
task-sdk/src/airflow/sdk/execution_time/task_runner.py:1914 hook='on_task_instance_skipped'
task-sdk/src/airflow/sdk/execution_time/task_runner.py:1922 hook='on_task_instance_failed'
task-sdk/src/airflow/sdk/execution_time/task_runner.py:1932 hook='on_task_instance_failed'
airflow-core/src/airflow/models/taskinstance.py:1779 hook='on_task_instance_failed'
airflow-core/src/airflow/api_fastapi/.../task_instances.py:83 hook='on_task_instance_success'
airflow-core/src/airflow/api_fastapi/.../task_instances.py:92 hook='on_task_instance_failed'
airflow-core/src/airflow/api_fastapi/.../task_instances.py:97 hook='on_task_instance_skipped'
Runtime log call: call('error calling listener for hook %r', 'on_task_instance_failed')

9/9 TI listener call sites updated. Lifecycle hooks (on_starting, before_stopping) are scoped to the follow-up #66397.

Real e2e validation (Airflow standalone)

Re-ran with airflow standalone (real scheduler + API server + LocalExecutor + sqlite). Registered a listener that raises on every TI hook; observed the new log format on every suppressed exception:

error calling listener for hook 'on_task_instance_running' (raised in _prepare, task_runner.py:1181)
error calling listener for hook 'on_task_instance_success' (raised in finalize, task_runner.py:1906)
error calling listener for hook 'on_task_instance_failed' (raised in finalize, task_runner.py:1932)
error calling listener for hook 'on_task_instance_skipped' (raised in finalize, task_runner.py:1914)

All 4 TI hooks now identify themselves by name in the log when an impl raises. Listener-exception suppression behavior is preserved — the DAGs that triggered these errors all completed normally (success/failed/skipped) regardless of the listener throwing.

Integrated mega-branch validation (all 7 PRs composed)

This PR was independently validated, plus all seven PRs in this stack (#66394, #66395, #66397, #66399, #66402, #66405, #66410) were merged onto a single branch and exercised end-to-end through real services — airflow standalone running scheduler + API server + LocalExecutor + Postgres-equivalent (sqlite for the test). A single listener plugin declaring every new hook and parameter was registered, then 5 DAGs covering every state-transition path were triggered + a manual-set-state PATCH via the public API was issued. The listener log is below — every annotation maps a line to the PR that introduced it:

running prev=QUEUED msg=started task=ok_task ← PR-A msg arg
success prev=RUNNING msg=success task=ok_task ← PR-A
running prev=QUEUED msg=started task=boom_task
failed prev=RUNNING msg=failed task=boom_task error_type=ValueError fd=None ← PR-A + PR-D + PR-F kwarg
running prev=QUEUED msg=started task=skip_task
skipped prev=RUNNING msg=skipped task=skip_task ← PR-A skipped path
running prev=QUEUED msg=started task=retry_task
failed prev=RUNNING msg=up_for_retry task=retry_task error_type=ValueError ← PR-A retry-vs-terminal
running prev=QUEUED msg=started task=retry_task (try 2 of 2)
failed prev=RUNNING msg=failed task=retry_task error_type=ValueError
running prev=QUEUED msg=started task=checkpoint_task
checkpointed prev=RUNNING task=checkpoint_task checkpoint_data={'step': 5,
'iterator_offset': 1024} ← PR-E + PR-G
--- BEGIN MANUAL SET (PATCH /api/v2/.../taskInstances/ok_task new_state=failed) ---
failed prev=None msg=manually_set_to_failed task=ok_task error_type=RuntimeError fd=None ← PR-D RuntimeError wrap
(would be `str` on the PR-A-only branch)

What this validates jointly:

PRSurfaceEvidence in log
#66394 (msg arg)every TI hook has msg=...6 canonical values fire (started, success, failed, skipped, up_for_retry, manually_set_to_failed)
#66395 (hook-name log, TI)logs identify the failing hooktested separately with throwing listener — see PR body
#66397 (hook-name log, rest)lifecycle / DagRun / asset surfacestested separately with throwing listener — see PR body
#66399 (tighten error type)error: BaseException | Nonemanual-set path delivers RuntimeError (was str on PR-A alone)
#66402 (CHECKPOINTED state)worker catches AirflowTaskCheckpointedrunning → checkpointed transition observed at the listener and at the supervisor message boundary
#66405 (FailureDetails)listener can declare failure_details kwargfailure_details=None flowing through every failure (no executor populates yet)
#66410 (on_task_instance_checkpointed)new hook fires with payloadcheckpointed task=checkpoint_task checkpoint_data={'step': 5, ...}

Repro

# Combine all 7 branches onto a mega branch (resolve trivial overlap on the# spec file's failure hook signature — error + msg + failure_details kwargs# in one signature) and install editable:
pip install -e shared/listeners -e task-sdk -e airflow-core
AIRFLOW__CORE__EXECUTOR=LocalExecutor airflow standalone &# Drop the recording listener (declares all 5 hooks including the new# checkpointed one) into $AIRFLOW_HOME/plugins/, drop 5 DAGs into dags/# (success / failed / skipped / retry-then-fail / checkpointed), trigger them.fordagin e2e_success e2e_failed e2e_skipped e2e_retry_then_fail e2e_checkpointed;do
airflow dags trigger $dagdone# Then PATCH a state via the public API to exercise the manual path.

Bugs surfaced and fixed during this validation

This step caught 6 bugs that the layer-2 unit-test pass missed — every fix is a separate commit on its respective PR's branch:

Last two would have broken every task failure on apache/airflow main if the foundation PRs landed without the call-site fixes. The standalone-against-editable-install harness is a fast catch for this class.

Documented gap (deliberately not fixed in this stack)

task-sdk/.../supervisor.py:STATES_SENT_DIRECTLY lists the states the worker sends to the supervisor with a dedicated direct-send branch. CHECKPOINTED is not in that list, so it falls back to client.task_instances.finish() which the API server constrains to terminal states. The mega listener log shows the worker successfully logging Task checkpointed; reporting CHECKPOINTED state. and on_task_instance_checkpointed firing with the correct payload — but the DB row eventually transitions to failed because the supervisor cannot persist CHECKPOINTED through finish(). This is the AIP-96 design knob (auto-resume vs manual-resume-only) we deliberately want the discussion to settle, not silently pick. Documented in #66402.


Note

🗂️ Maintainer triage note for @1fanwang · by @potiuk · 2026-06-12 11:31 UTC

This draft PR is being closed to keep the review queue tidy — it has been inactive for about 15 days with no updates since it was triaged.

This is not a rejection: you're very welcome to reopen it (or open a fresh PR) whenever you're ready to continue. Please rebase onto the current main first. No rush.

Automated triage — may be imperfect; a maintainer takes the next look.

When a listener hookimpl raises, the suppressed-exception log line now
identifies which hook raised. The previous generic "error calling listener"
made it impossible to tell which of the registered hooks failed without
re-reading the stack trace, especially painful when several listeners are
registered and one of them sporadically misbehaves.
The new format is "error calling listener for hook 'on_task_instance_<x>'".
Existing listener-error suppression behavior is preserved unchanged.
Scope: task instance listener call sites (task_runner.py, taskinstance.py
on the API server retry path, and the manual-set-state path in the
fastapi service). DagRun, asset, and dag-processing listener call sites
follow the same pattern and can be migrated incrementally.
@boring-cyborgboring-cyborgBot added area:API Airflow's REST/HTTP API area:task-sdk labels May 5, 2026
1fanwang added 5 commits May 5, 2026 13:45
stdlib Logger.exception accepts (msg, *args) but not arbitrary kwargs;
mypy flagged log.exception('msg', hook=name) as call-arg error in
taskinstance.py and other stdlib-Logger sites.
Reverting to format-string form which works for both stdlib and structlog
loggers. The structlog adapter interpolates the format args into the
event field, so cap_structlog still captures the rendered hook name.
Tests updated to match the rendered event field.
1fanwang added a commit to 1fanwang/airflow that referenced this pull request May 6, 2026
Mirrors the same fix in PR-B (apache#66395) — extends to lifecycle and asset
listener call sites.
@potiuk

Copy link
Copy Markdown
Member

@1fanwang A few things need addressing before review — see our Pull Request quality criteria.

  • Provider tests. See docs.

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 so that our maintainers' limited time is spent where it matters most: the conversation with you.

@potiukpotiuk closed this Jun 12, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:APIAirflow's REST/HTTP APIarea:task-sdk

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@1fanwang@potiuk
, 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' Include hook name in suppressed listener-exception log by 1fanwang · Pull Request #66395 · apache/airflow · GitHub
Skip to content

Include hook name in suppressed listener-exception log - #66395

Closed
1fanwang wants to merge 7 commits into
apache:mainfrom
1fanwang:1fanwang/listener-log-hook-context
Closed

Include hook name in suppressed listener-exception log#66395
1fanwang wants to merge 7 commits into
apache:mainfrom
1fanwang:1fanwang/listener-log-hook-context

Conversation

@1fanwang

@1fanwang1fanwang commented May 5, 2026

Copy link
Copy Markdown
Contributor

Description

When a listener hookimpl raises, the suppressed-exception log line now
identifies which hook raised. The previous generic
log.exception(\"error calling listener\") made it impossible to tell which
of the registered hooks failed without re-reading the stack trace —
especially painful when several listeners are registered and one of them
sporadically misbehaves.

New format:

```text
error calling listener for hook 'on_task_instance_failed'
```

The existing substring error calling listener remains in the message,
so any downstream log-grep tooling continues to match.

Scope

This PR covers the task instance listener call sites only, mirroring
the surface of #66394:

  • task-sdk/src/airflow/sdk/execution_time/task_runner.py — 5 sites
    (running, success, skipped, up_for_retry, failed)
  • airflow-core/src/airflow/models/taskinstance.py — 1 site (API
    server retry path)
  • airflow-core/src/airflow/api_fastapi/core_api/services/public/task_instances.py
    — split the single try/except wrapping three branches into per-branch
    try/except so each log line names exactly one hook

DagRun, asset, dag-processing, and lifecycle listener call sites follow the
same pattern and can be migrated as a follow-up; keeping this PR narrow
makes the diff trivially reviewable.

Behavior

Listener-exception suppression is preserved — task execution is not
affected by listener failures.

Testing

  • Existing test test_listener_suppresses_exceptions (airflow-core) is
    extended to also assert the hook name appears in the captured log
    output. It uses the existing throwing_listener fixture which raises
    in on_task_instance_success.
  • New unit test test_listener_error_log_includes_hook_name (task-sdk)
    registers a listener that raises in on_task_instance_success,
    drives the runner, and asserts log.exception was called with
    (\"error calling listener for hook %r\", \"on_task_instance_success\").

^ Add meaningful description above
Read the Pull Request Guidelines for more information.

E2E validation

=== TI listener call sites with hook name in log ===
task-sdk/src/airflow/sdk/execution_time/task_runner.py:1181 hook='on_task_instance_running'
task-sdk/src/airflow/sdk/execution_time/task_runner.py:1906 hook='on_task_instance_success'
task-sdk/src/airflow/sdk/execution_time/task_runner.py:1914 hook='on_task_instance_skipped'
task-sdk/src/airflow/sdk/execution_time/task_runner.py:1922 hook='on_task_instance_failed'
task-sdk/src/airflow/sdk/execution_time/task_runner.py:1932 hook='on_task_instance_failed'
airflow-core/src/airflow/models/taskinstance.py:1779 hook='on_task_instance_failed'
airflow-core/src/airflow/api_fastapi/.../task_instances.py:83 hook='on_task_instance_success'
airflow-core/src/airflow/api_fastapi/.../task_instances.py:92 hook='on_task_instance_failed'
airflow-core/src/airflow/api_fastapi/.../task_instances.py:97 hook='on_task_instance_skipped'
Runtime log call: call('error calling listener for hook %r', 'on_task_instance_failed')

9/9 TI listener call sites updated. Lifecycle hooks (on_starting, before_stopping) are scoped to the follow-up #66397.

Real e2e validation (Airflow standalone)

Re-ran with airflow standalone (real scheduler + API server + LocalExecutor + sqlite). Registered a listener that raises on every TI hook; observed the new log format on every suppressed exception:

error calling listener for hook 'on_task_instance_running' (raised in _prepare, task_runner.py:1181)
error calling listener for hook 'on_task_instance_success' (raised in finalize, task_runner.py:1906)
error calling listener for hook 'on_task_instance_failed' (raised in finalize, task_runner.py:1932)
error calling listener for hook 'on_task_instance_skipped' (raised in finalize, task_runner.py:1914)

All 4 TI hooks now identify themselves by name in the log when an impl raises. Listener-exception suppression behavior is preserved — the DAGs that triggered these errors all completed normally (success/failed/skipped) regardless of the listener throwing.

Integrated mega-branch validation (all 7 PRs composed)

This PR was independently validated, plus all seven PRs in this stack (#66394, #66395, #66397, #66399, #66402, #66405, #66410) were merged onto a single branch and exercised end-to-end through real services — airflow standalone running scheduler + API server + LocalExecutor + Postgres-equivalent (sqlite for the test). A single listener plugin declaring every new hook and parameter was registered, then 5 DAGs covering every state-transition path were triggered + a manual-set-state PATCH via the public API was issued. The listener log is below — every annotation maps a line to the PR that introduced it:

running prev=QUEUED msg=started task=ok_task ← PR-A msg arg
success prev=RUNNING msg=success task=ok_task ← PR-A
running prev=QUEUED msg=started task=boom_task
failed prev=RUNNING msg=failed task=boom_task error_type=ValueError fd=None ← PR-A + PR-D + PR-F kwarg
running prev=QUEUED msg=started task=skip_task
skipped prev=RUNNING msg=skipped task=skip_task ← PR-A skipped path
running prev=QUEUED msg=started task=retry_task
failed prev=RUNNING msg=up_for_retry task=retry_task error_type=ValueError ← PR-A retry-vs-terminal
running prev=QUEUED msg=started task=retry_task (try 2 of 2)
failed prev=RUNNING msg=failed task=retry_task error_type=ValueError
running prev=QUEUED msg=started task=checkpoint_task
checkpointed prev=RUNNING task=checkpoint_task checkpoint_data={'step': 5,
'iterator_offset': 1024} ← PR-E + PR-G
--- BEGIN MANUAL SET (PATCH /api/v2/.../taskInstances/ok_task new_state=failed) ---
failed prev=None msg=manually_set_to_failed task=ok_task error_type=RuntimeError fd=None ← PR-D RuntimeError wrap
(would be `str` on the PR-A-only branch)

What this validates jointly:

PRSurfaceEvidence in log
#66394 (msg arg)every TI hook has msg=...6 canonical values fire (started, success, failed, skipped, up_for_retry, manually_set_to_failed)
#66395 (hook-name log, TI)logs identify the failing hooktested separately with throwing listener — see PR body
#66397 (hook-name log, rest)lifecycle / DagRun / asset surfacestested separately with throwing listener — see PR body
#66399 (tighten error type)error: BaseException | Nonemanual-set path delivers RuntimeError (was str on PR-A alone)
#66402 (CHECKPOINTED state)worker catches AirflowTaskCheckpointedrunning → checkpointed transition observed at the listener and at the supervisor message boundary
#66405 (FailureDetails)listener can declare failure_details kwargfailure_details=None flowing through every failure (no executor populates yet)
#66410 (on_task_instance_checkpointed)new hook fires with payloadcheckpointed task=checkpoint_task checkpoint_data={'step': 5, ...}

Repro

# Combine all 7 branches onto a mega branch (resolve trivial overlap on the# spec file's failure hook signature — error + msg + failure_details kwargs# in one signature) and install editable:
pip install -e shared/listeners -e task-sdk -e airflow-core
AIRFLOW__CORE__EXECUTOR=LocalExecutor airflow standalone &# Drop the recording listener (declares all 5 hooks including the new# checkpointed one) into $AIRFLOW_HOME/plugins/, drop 5 DAGs into dags/# (success / failed / skipped / retry-then-fail / checkpointed), trigger them.fordagin e2e_success e2e_failed e2e_skipped e2e_retry_then_fail e2e_checkpointed;do
airflow dags trigger $dagdone# Then PATCH a state via the public API to exercise the manual path.

Bugs surfaced and fixed during this validation

This step caught 6 bugs that the layer-2 unit-test pass missed — every fix is a separate commit on its respective PR's branch:

Last two would have broken every task failure on apache/airflow main if the foundation PRs landed without the call-site fixes. The standalone-against-editable-install harness is a fast catch for this class.

Documented gap (deliberately not fixed in this stack)

task-sdk/.../supervisor.py:STATES_SENT_DIRECTLY lists the states the worker sends to the supervisor with a dedicated direct-send branch. CHECKPOINTED is not in that list, so it falls back to client.task_instances.finish() which the API server constrains to terminal states. The mega listener log shows the worker successfully logging Task checkpointed; reporting CHECKPOINTED state. and on_task_instance_checkpointed firing with the correct payload — but the DB row eventually transitions to failed because the supervisor cannot persist CHECKPOINTED through finish(). This is the AIP-96 design knob (auto-resume vs manual-resume-only) we deliberately want the discussion to settle, not silently pick. Documented in #66402.


Note

🗂️ Maintainer triage note for @1fanwang · by @potiuk · 2026-06-12 11:31 UTC

This draft PR is being closed to keep the review queue tidy — it has been inactive for about 15 days with no updates since it was triaged.

This is not a rejection: you're very welcome to reopen it (or open a fresh PR) whenever you're ready to continue. Please rebase onto the current main first. No rush.

Automated triage — may be imperfect; a maintainer takes the next look.

When a listener hookimpl raises, the suppressed-exception log line now
identifies which hook raised. The previous generic "error calling listener"
made it impossible to tell which of the registered hooks failed without
re-reading the stack trace, especially painful when several listeners are
registered and one of them sporadically misbehaves.
The new format is "error calling listener for hook 'on_task_instance_<x>'".
Existing listener-error suppression behavior is preserved unchanged.
Scope: task instance listener call sites (task_runner.py, taskinstance.py
on the API server retry path, and the manual-set-state path in the
fastapi service). DagRun, asset, and dag-processing listener call sites
follow the same pattern and can be migrated incrementally.
@boring-cyborgboring-cyborgBot added area:API Airflow's REST/HTTP API area:task-sdk labels May 5, 2026
1fanwang added 5 commits May 5, 2026 13:45
stdlib Logger.exception accepts (msg, *args) but not arbitrary kwargs;
mypy flagged log.exception('msg', hook=name) as call-arg error in
taskinstance.py and other stdlib-Logger sites.
Reverting to format-string form which works for both stdlib and structlog
loggers. The structlog adapter interpolates the format args into the
event field, so cap_structlog still captures the rendered hook name.
Tests updated to match the rendered event field.
1fanwang added a commit to 1fanwang/airflow that referenced this pull request May 6, 2026
Mirrors the same fix in PR-B (apache#66395) — extends to lifecycle and asset
listener call sites.
@potiuk

Copy link
Copy Markdown
Member

@1fanwang A few things need addressing before review — see our Pull Request quality criteria.

  • Provider tests. See docs.

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 so that our maintainers' limited time is spent where it matters most: the conversation with you.

@potiukpotiuk closed this Jun 12, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:APIAirflow's REST/HTTP APIarea:task-sdk

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@1fanwang@potiuk
, 'i'); if (__m === '*' || __re.test(location.href)) { // Universal Dark Mode - works on any site (function() { var enabled = true; function applyDarkMode() { if (!enabled) return; // Create style element if it doesn't exist var style = document.getElementById('universal-dark-mode-style'); if (!style) { style = document.createElement('style'); style.id = 'universal-dark-mode-style'; document.head.appendChild(style); } // Dark mode CSS - inverts colors but preserves images/video style.textContent = ' /* Invert everything except media */ html { filter: invert(1) hue-rotate(180deg) !important; background: #1a1a2e !important; } /* Restore images, videos, iframes, canvas */ img, video, iframe, canvas, svg, picture, [style*="background-image"] { filter: invert(1) hue-rotate(180deg) !important; } /* Preserve specific elements that should not be inverted */ .no-dark-mode, .no-dark-mode *, [data-theme="light"], [data-theme="light"], .ace_editor, .ace_editor *, .CodeMirror, .CodeMirror *, .monaco-editor, .monaco-editor *, .markdown-body pre, .markdown-body pre *, .highlight, .highlight *, pre code, pre code * { filter: none !important; } /* Fix common UI elements */ .modal, .popup, .dropdown-menu, .tooltip, .popover { filter: invert(1) hue-rotate(180deg) !important; background: #2d2d44 !important; border-color: #444 !important; } /* Scrollbars */ ::-webkit-scrollbar { background: #1a1a2e !important; } ::-webkit-scrollbar-thumb { background: #444 !important; } ::-webkit-scrollbar-thumb:hover { background: #555 !important; } /* Selection */ ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; } ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; } '; } function removeDarkMode() { var style = document.getElementById('universal-dark-mode-style'); if (style) style.remove(); } // Toggle with Alt+Shift+D document.addEventListener('keydown', function(e) { if (e.altKey && e.shiftKey && e.key === 'D') { e.preventDefault(); enabled = !enabled; if (enabled) { applyDarkMode(); console.log('[Universal Dark Mode] Enabled'); } else { removeDarkMode(); console.log('[Universal Dark Mode] Disabled'); } } }); // Apply on load applyDarkMode(); // Re-apply on dynamic content var observer = new MutationObserver(function(mutations) { if (enabled && !document.getElementById('universal-dark-mode-style')) { applyDarkMode(); } }); observer.observe(document.head, { childList: true }); console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle'); })(); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })(); Include hook name in suppressed listener-exception log by 1fanwang · Pull Request #66395 · apache/airflow · GitHub
Skip to content

Include hook name in suppressed listener-exception log - #66395

Closed
1fanwang wants to merge 7 commits into
apache:mainfrom
1fanwang:1fanwang/listener-log-hook-context
Closed

Include hook name in suppressed listener-exception log#66395
1fanwang wants to merge 7 commits into
apache:mainfrom
1fanwang:1fanwang/listener-log-hook-context

Conversation

@1fanwang

@1fanwang1fanwang commented May 5, 2026

Copy link
Copy Markdown
Contributor

Description

When a listener hookimpl raises, the suppressed-exception log line now
identifies which hook raised. The previous generic
log.exception(\"error calling listener\") made it impossible to tell which
of the registered hooks failed without re-reading the stack trace —
especially painful when several listeners are registered and one of them
sporadically misbehaves.

New format:

```text
error calling listener for hook 'on_task_instance_failed'
```

The existing substring error calling listener remains in the message,
so any downstream log-grep tooling continues to match.

Scope

This PR covers the task instance listener call sites only, mirroring
the surface of #66394:

  • task-sdk/src/airflow/sdk/execution_time/task_runner.py — 5 sites
    (running, success, skipped, up_for_retry, failed)
  • airflow-core/src/airflow/models/taskinstance.py — 1 site (API
    server retry path)
  • airflow-core/src/airflow/api_fastapi/core_api/services/public/task_instances.py
    — split the single try/except wrapping three branches into per-branch
    try/except so each log line names exactly one hook

DagRun, asset, dag-processing, and lifecycle listener call sites follow the
same pattern and can be migrated as a follow-up; keeping this PR narrow
makes the diff trivially reviewable.

Behavior

Listener-exception suppression is preserved — task execution is not
affected by listener failures.

Testing

  • Existing test test_listener_suppresses_exceptions (airflow-core) is
    extended to also assert the hook name appears in the captured log
    output. It uses the existing throwing_listener fixture which raises
    in on_task_instance_success.
  • New unit test test_listener_error_log_includes_hook_name (task-sdk)
    registers a listener that raises in on_task_instance_success,
    drives the runner, and asserts log.exception was called with
    (\"error calling listener for hook %r\", \"on_task_instance_success\").

^ Add meaningful description above
Read the Pull Request Guidelines for more information.

E2E validation

=== TI listener call sites with hook name in log ===
task-sdk/src/airflow/sdk/execution_time/task_runner.py:1181 hook='on_task_instance_running'
task-sdk/src/airflow/sdk/execution_time/task_runner.py:1906 hook='on_task_instance_success'
task-sdk/src/airflow/sdk/execution_time/task_runner.py:1914 hook='on_task_instance_skipped'
task-sdk/src/airflow/sdk/execution_time/task_runner.py:1922 hook='on_task_instance_failed'
task-sdk/src/airflow/sdk/execution_time/task_runner.py:1932 hook='on_task_instance_failed'
airflow-core/src/airflow/models/taskinstance.py:1779 hook='on_task_instance_failed'
airflow-core/src/airflow/api_fastapi/.../task_instances.py:83 hook='on_task_instance_success'
airflow-core/src/airflow/api_fastapi/.../task_instances.py:92 hook='on_task_instance_failed'
airflow-core/src/airflow/api_fastapi/.../task_instances.py:97 hook='on_task_instance_skipped'
Runtime log call: call('error calling listener for hook %r', 'on_task_instance_failed')

9/9 TI listener call sites updated. Lifecycle hooks (on_starting, before_stopping) are scoped to the follow-up #66397.

Real e2e validation (Airflow standalone)

Re-ran with airflow standalone (real scheduler + API server + LocalExecutor + sqlite). Registered a listener that raises on every TI hook; observed the new log format on every suppressed exception:

error calling listener for hook 'on_task_instance_running' (raised in _prepare, task_runner.py:1181)
error calling listener for hook 'on_task_instance_success' (raised in finalize, task_runner.py:1906)
error calling listener for hook 'on_task_instance_failed' (raised in finalize, task_runner.py:1932)
error calling listener for hook 'on_task_instance_skipped' (raised in finalize, task_runner.py:1914)

All 4 TI hooks now identify themselves by name in the log when an impl raises. Listener-exception suppression behavior is preserved — the DAGs that triggered these errors all completed normally (success/failed/skipped) regardless of the listener throwing.

Integrated mega-branch validation (all 7 PRs composed)

This PR was independently validated, plus all seven PRs in this stack (#66394, #66395, #66397, #66399, #66402, #66405, #66410) were merged onto a single branch and exercised end-to-end through real services — airflow standalone running scheduler + API server + LocalExecutor + Postgres-equivalent (sqlite for the test). A single listener plugin declaring every new hook and parameter was registered, then 5 DAGs covering every state-transition path were triggered + a manual-set-state PATCH via the public API was issued. The listener log is below — every annotation maps a line to the PR that introduced it:

running prev=QUEUED msg=started task=ok_task ← PR-A msg arg
success prev=RUNNING msg=success task=ok_task ← PR-A
running prev=QUEUED msg=started task=boom_task
failed prev=RUNNING msg=failed task=boom_task error_type=ValueError fd=None ← PR-A + PR-D + PR-F kwarg
running prev=QUEUED msg=started task=skip_task
skipped prev=RUNNING msg=skipped task=skip_task ← PR-A skipped path
running prev=QUEUED msg=started task=retry_task
failed prev=RUNNING msg=up_for_retry task=retry_task error_type=ValueError ← PR-A retry-vs-terminal
running prev=QUEUED msg=started task=retry_task (try 2 of 2)
failed prev=RUNNING msg=failed task=retry_task error_type=ValueError
running prev=QUEUED msg=started task=checkpoint_task
checkpointed prev=RUNNING task=checkpoint_task checkpoint_data={'step': 5,
'iterator_offset': 1024} ← PR-E + PR-G
--- BEGIN MANUAL SET (PATCH /api/v2/.../taskInstances/ok_task new_state=failed) ---
failed prev=None msg=manually_set_to_failed task=ok_task error_type=RuntimeError fd=None ← PR-D RuntimeError wrap
(would be `str` on the PR-A-only branch)

What this validates jointly:

PRSurfaceEvidence in log
#66394 (msg arg)every TI hook has msg=...6 canonical values fire (started, success, failed, skipped, up_for_retry, manually_set_to_failed)
#66395 (hook-name log, TI)logs identify the failing hooktested separately with throwing listener — see PR body
#66397 (hook-name log, rest)lifecycle / DagRun / asset surfacestested separately with throwing listener — see PR body
#66399 (tighten error type)error: BaseException | Nonemanual-set path delivers RuntimeError (was str on PR-A alone)
#66402 (CHECKPOINTED state)worker catches AirflowTaskCheckpointedrunning → checkpointed transition observed at the listener and at the supervisor message boundary
#66405 (FailureDetails)listener can declare failure_details kwargfailure_details=None flowing through every failure (no executor populates yet)
#66410 (on_task_instance_checkpointed)new hook fires with payloadcheckpointed task=checkpoint_task checkpoint_data={'step': 5, ...}

Repro

# Combine all 7 branches onto a mega branch (resolve trivial overlap on the# spec file's failure hook signature — error + msg + failure_details kwargs# in one signature) and install editable:
pip install -e shared/listeners -e task-sdk -e airflow-core
AIRFLOW__CORE__EXECUTOR=LocalExecutor airflow standalone &# Drop the recording listener (declares all 5 hooks including the new# checkpointed one) into $AIRFLOW_HOME/plugins/, drop 5 DAGs into dags/# (success / failed / skipped / retry-then-fail / checkpointed), trigger them.fordagin e2e_success e2e_failed e2e_skipped e2e_retry_then_fail e2e_checkpointed;do
airflow dags trigger $dagdone# Then PATCH a state via the public API to exercise the manual path.

Bugs surfaced and fixed during this validation

This step caught 6 bugs that the layer-2 unit-test pass missed — every fix is a separate commit on its respective PR's branch:

Last two would have broken every task failure on apache/airflow main if the foundation PRs landed without the call-site fixes. The standalone-against-editable-install harness is a fast catch for this class.

Documented gap (deliberately not fixed in this stack)

task-sdk/.../supervisor.py:STATES_SENT_DIRECTLY lists the states the worker sends to the supervisor with a dedicated direct-send branch. CHECKPOINTED is not in that list, so it falls back to client.task_instances.finish() which the API server constrains to terminal states. The mega listener log shows the worker successfully logging Task checkpointed; reporting CHECKPOINTED state. and on_task_instance_checkpointed firing with the correct payload — but the DB row eventually transitions to failed because the supervisor cannot persist CHECKPOINTED through finish(). This is the AIP-96 design knob (auto-resume vs manual-resume-only) we deliberately want the discussion to settle, not silently pick. Documented in #66402.


Note

🗂️ Maintainer triage note for @1fanwang · by @potiuk · 2026-06-12 11:31 UTC

This draft PR is being closed to keep the review queue tidy — it has been inactive for about 15 days with no updates since it was triaged.

This is not a rejection: you're very welcome to reopen it (or open a fresh PR) whenever you're ready to continue. Please rebase onto the current main first. No rush.

Automated triage — may be imperfect; a maintainer takes the next look.

When a listener hookimpl raises, the suppressed-exception log line now
identifies which hook raised. The previous generic "error calling listener"
made it impossible to tell which of the registered hooks failed without
re-reading the stack trace, especially painful when several listeners are
registered and one of them sporadically misbehaves.
The new format is "error calling listener for hook 'on_task_instance_<x>'".
Existing listener-error suppression behavior is preserved unchanged.
Scope: task instance listener call sites (task_runner.py, taskinstance.py
on the API server retry path, and the manual-set-state path in the
fastapi service). DagRun, asset, and dag-processing listener call sites
follow the same pattern and can be migrated incrementally.
@boring-cyborgboring-cyborgBot added area:API Airflow's REST/HTTP API area:task-sdk labels May 5, 2026
1fanwang added 5 commits May 5, 2026 13:45
stdlib Logger.exception accepts (msg, *args) but not arbitrary kwargs;
mypy flagged log.exception('msg', hook=name) as call-arg error in
taskinstance.py and other stdlib-Logger sites.
Reverting to format-string form which works for both stdlib and structlog
loggers. The structlog adapter interpolates the format args into the
event field, so cap_structlog still captures the rendered hook name.
Tests updated to match the rendered event field.
1fanwang added a commit to 1fanwang/airflow that referenced this pull request May 6, 2026
Mirrors the same fix in PR-B (apache#66395) — extends to lifecycle and asset
listener call sites.
@potiuk

Copy link
Copy Markdown
Member

@1fanwang A few things need addressing before review — see our Pull Request quality criteria.

  • Provider tests. See docs.

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 so that our maintainers' limited time is spent where it matters most: the conversation with you.

@potiukpotiuk closed this Jun 12, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:APIAirflow's REST/HTTP APIarea:task-sdk

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@1fanwang@potiuk