Skip to content

[v3-3-test] Fix one bad callback request crashing the Dag processor and dropping the rest (#70990) - #71608

Merged
potiuk merged 1 commit into
v3-3-testfrom
backport-13b2969-v3-3-test
Aug 17, 2026
Merged

potiuk merged 1 commit into
v3-3-testfrom
backport-13b2969-v3-3-test

Conversation

@github-actions

Copy link
Copy Markdown
Contributor
  • Fix one bad callback request crashing the Dag processor and dropping the rest

A callback request that hits the documented race condition (the Dag or
task was removed between scheduling the callback and parsing the file)
raises out of _execute_callbacks, killing the parse subprocess. The
remaining requests in the batch were already popped from the manager's
queue, so on_failure_callback, on_retry_callback, and failure-email
requests behind the bad one are lost permanently. Isolate each request
so a failure is logged and the rest still execute, and route the
last_ti task lookup through _get_dag_with_task so a removed task
surfaces as the race-condition error instead of a raw TaskNotFound.

  • Serialize callback request once per loop iteration

Avoids a second to_json() in the exception handler, where a
serialization failure would mask the original error and abort the
batch the handler exists to protect.

  • Address review: keep run conf out of logs and deliver Dag callbacks when only the task is gone

The last_ti task lookup only enriches the callback context, so a task
removed since the run should downgrade to the minimal context (as
produce_dag_callback already does for an unrepresentable last_ti)
instead of costing the user the callback. The failure log leaked
user-supplied dag_run.conf at ERROR via the serialized request and
carried no structured identifiers; it now excludes context_from_server
and binds dag_id/run_id/ti_id so log filters can match the line.

  • fixup! Address review: keep run conf out of logs and deliver Dag callbacks when only the task is gone
    (cherry picked from commit 13b2969)

Co-authored-by: Ephraim Anierobi [email protected]

…nd dropping the rest (#70990)

* Fix one bad callback request crashing the Dag processor and dropping the rest

A callback request that hits the documented race condition (the Dag or
task was removed between scheduling the callback and parsing the file)
raises out of _execute_callbacks, killing the parse subprocess. The
remaining requests in the batch were already popped from the manager's
queue, so on_failure_callback, on_retry_callback, and failure-email
requests behind the bad one are lost permanently. Isolate each request
so a failure is logged and the rest still execute, and route the
last_ti task lookup through _get_dag_with_task so a removed task
surfaces as the race-condition error instead of a raw TaskNotFound.

* Serialize callback request once per loop iteration

Avoids a second to_json() in the exception handler, where a
serialization failure would mask the original error and abort the
batch the handler exists to protect.

* Address review: keep run conf out of logs and deliver Dag callbacks when only the task is gone

The last_ti task lookup only enriches the callback context, so a task
removed since the run should downgrade to the minimal context (as
produce_dag_callback already does for an unrepresentable last_ti)
instead of costing the user the callback. The failure log leaked
user-supplied dag_run.conf at ERROR via the serialized request and
carried no structured identifiers; it now excludes context_from_server
and binds dag_id/run_id/ti_id so log filters can match the line.

* fixup! Address review: keep run conf out of logs and deliver Dag callbacks when only the task is gone
(cherry picked from commit 13b2969)

Co-authored-by: Ephraim Anierobi <[email protected]>
@potiuk
potiuk force-pushed the backport-13b2969-v3-3-test branch from 41a62a5 to 58dceae Compare August 17, 2026 12:30
@potiuk
potiuk marked this pull request as ready for review August 17, 2026 12:30

@potiuk potiuk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Rebased onto the current v3-3-test tip; the backport replays cleanly and the tests and prek hooks it touches pass locally against this branch.

Scope-checked for a maintenance branch: this is a bugfix / documentation / dev-tooling change, with no new user-facing behaviour.


Drafted-by: Claude Code (Opus 5) (no human review before posting)

@potiuk
potiuk merged commit b28c4ad into v3-3-test Aug 17, 2026
74 of 75 checks passed
@potiuk
potiuk deleted the backport-13b2969-v3-3-test branch August 17, 2026 16:17
@github-actions github-actions Bot added this to the Airflow 3.3.2 milestone Aug 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor Author

Hi maintainer, this PR was merged without a milestone set.
We've automatically set the milestone to Airflow 3.3.2 based on: bug fix merged to version branch
If this milestone is not correct, please update it to the appropriate milestone.

This comment was generated by Milestone Tag Assistant.

vatsrahul1001 pushed a commit that referenced this pull request Sep 7, 2026
…nd dropping the rest (#70990) (#71608)

* Fix one bad callback request crashing the Dag processor and dropping the rest

A callback request that hits the documented race condition (the Dag or
task was removed between scheduling the callback and parsing the file)
raises out of _execute_callbacks, killing the parse subprocess. The
remaining requests in the batch were already popped from the manager's
queue, so on_failure_callback, on_retry_callback, and failure-email
requests behind the bad one are lost permanently. Isolate each request
so a failure is logged and the rest still execute, and route the
last_ti task lookup through _get_dag_with_task so a removed task
surfaces as the race-condition error instead of a raw TaskNotFound.

* Serialize callback request once per loop iteration

Avoids a second to_json() in the exception handler, where a
serialization failure would mask the original error and abort the
batch the handler exists to protect.

* Address review: keep run conf out of logs and deliver Dag callbacks when only the task is gone

The last_ti task lookup only enriches the callback context, so a task
removed since the run should downgrade to the minimal context (as
produce_dag_callback already does for an unrepresentable last_ti)
instead of costing the user the callback. The failure log leaked
user-supplied dag_run.conf at ERROR via the serialized request and
carried no structured identifiers; it now excludes context_from_server
and binds dag_id/run_id/ti_id so log filters can match the line.

* fixup! Address review: keep run conf out of logs and deliver Dag callbacks when only the task is gone
(cherry picked from commit 13b2969)

Co-authored-by: Ephraim Anierobi <[email protected]>
@vatsrahul1001 vatsrahul1001 added the type:bug-fix Changelog: Bug Fixes label Sep 8, 2026
kravii pushed a commit to acceldata-io/airflow that referenced this pull request Nov 19, 2026
…nd dropping the rest (apache#70990) (apache#71608)

* Fix one bad callback request crashing the Dag processor and dropping the rest

A callback request that hits the documented race condition (the Dag or
task was removed between scheduling the callback and parsing the file)
raises out of _execute_callbacks, killing the parse subprocess. The
remaining requests in the batch were already popped from the manager's
queue, so on_failure_callback, on_retry_callback, and failure-email
requests behind the bad one are lost permanently. Isolate each request
so a failure is logged and the rest still execute, and route the
last_ti task lookup through _get_dag_with_task so a removed task
surfaces as the race-condition error instead of a raw TaskNotFound.

* Serialize callback request once per loop iteration

Avoids a second to_json() in the exception handler, where a
serialization failure would mask the original error and abort the
batch the handler exists to protect.

* Address review: keep run conf out of logs and deliver Dag callbacks when only the task is gone

The last_ti task lookup only enriches the callback context, so a task
removed since the run should downgrade to the minimal context (as
produce_dag_callback already does for an unrepresentable last_ti)
instead of costing the user the callback. The failure log leaked
user-supplied dag_run.conf at ERROR via the serialized request and
carried no structured identifiers; it now excludes context_from_server
and binds dag_id/run_id/ti_id so log filters can match the line.

* fixup! Address review: keep run conf out of logs and deliver Dag callbacks when only the task is gone
(cherry picked from commit 13b2969)

Co-authored-by: Ephraim Anierobi <[email protected]>
(cherry picked from commit b9154e5)
senthh pushed a commit to acceldata-io/airflow that referenced this pull request Nov 23, 2026
…nd dropping the rest (apache#70990) (apache#71608)

* Fix one bad callback request crashing the Dag processor and dropping the rest

A callback request that hits the documented race condition (the Dag or
task was removed between scheduling the callback and parsing the file)
raises out of _execute_callbacks, killing the parse subprocess. The
remaining requests in the batch were already popped from the manager's
queue, so on_failure_callback, on_retry_callback, and failure-email
requests behind the bad one are lost permanently. Isolate each request
so a failure is logged and the rest still execute, and route the
last_ti task lookup through _get_dag_with_task so a removed task
surfaces as the race-condition error instead of a raw TaskNotFound.

* Serialize callback request once per loop iteration

Avoids a second to_json() in the exception handler, where a
serialization failure would mask the original error and abort the
batch the handler exists to protect.

* Address review: keep run conf out of logs and deliver Dag callbacks when only the task is gone

The last_ti task lookup only enriches the callback context, so a task
removed since the run should downgrade to the minimal context (as
produce_dag_callback already does for an unrepresentable last_ti)
instead of costing the user the callback. The failure log leaked
user-supplied dag_run.conf at ERROR via the serialized request and
carried no structured identifiers; it now excludes context_from_server
and binds dag_id/run_id/ti_id so log filters can match the line.

* fixup! Address review: keep run conf out of logs and deliver Dag callbacks when only the task is gone
(cherry picked from commit 13b2969)

Co-authored-by: Ephraim Anierobi <[email protected]>
(cherry picked from commit b9154e5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants