The GitHub Actions job "Tests (AMD)" on airflow.git/cherry-pick-70685-v3-3-test 
has succeeded.
Run started by GitHub user vatsrahul1001 (triggered by vatsrahul1001).

Head commit for run:
332d11f78ff03f9a57256a5f126729f7c31077e1 / Jarek Potiuk <[email protected]>
Fail task instances whose stored next_kwargs cannot be processed (#70685)

* Fail task instances whose stored next_kwargs cannot be processed

handle_event_submit decoded a task instance's stored next_kwargs and assumed
the result was a dict. Neither assumption held: the decode caught only four
exception types, so anything the BaseSerialization fallback raised escaped,
and the isinstance check sat under TYPE_CHECKING, so it never ran at runtime.

Both escape as exceptions from a function whose callers walk every waiting
task instance in one pass — the scheduler's timeout sweep and two API routes
— so a single unusable payload aborted the whole batch.

Decode through a helper that checks its result, and guard decode, event
insertion and re-encode together. A task instance whose payload cannot be
processed is re-queued to fail through the existing __fail__ path, so its
normal retry and callback handling still runs, instead of being left parked
for the next sweep to trip over again.

Generated-by: Claude Opus 5 (1M context) following the guidelines at
https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions

* Report why a task instance could not be resumed, and to whom

The Dag author sees only the task log, so the traceback has to travel in
next_kwargs the way submit_failure already sends it; the process log where this
runs is often not theirs to read.

Decode and re-encode also fail for different reasons: blaming the stored kwargs
for a payload the trigger just yielded points the author at database state that
was never at fault. The sweep's summary counted an unresumable task as resolved.

* Update airflow-core/src/airflow/models/trigger.py

Co-authored-by: Amogh Desai <[email protected]>

* Fix ruff D205/D213 on _fail_unresumable_task_instance docstring

One-line summary on the second line + blank line before the description, so the 
docstring
satisfies both D205 (blank between summary and description) and D213 (summary 
on second line).
Static checks were failing on ruff for this.

---------

Co-authored-by: Amogh Desai <[email protected]>
Co-authored-by: Rahul Vats <[email protected]>
(cherry picked from commit 2b7a0be359cd7bd9da9054aeac6762b14e286762)

Report URL: https://github.com/apache/airflow/actions/runs/31015080680

With regards,
GitHub Actions via GitBox


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to