Skip to content

[v3-4-test] Decode deadline callback kwargs where the callback runs (#74830) - #75114

Merged
potiuk merged 1 commit into
v3-4-testfrom
backport-233f9c3-v3-4-test
Oct 19, 2026
Merged

potiuk merged 1 commit into
v3-4-testfrom
backport-233f9c3-v3-4-test

Conversation

@github-actions

Copy link
Copy Markdown
Contributor
  • Decode deadline callback kwargs where the callback runs

Deadline Alert callback kwargs were decoded in the scheduler and the API
server whenever deadline alerts were loaded, although neither component
calls the callback. Keep the kwargs serde-encoded on the server and
decode them where they are used: the triggerer decodes AsyncCallback
kwargs with its existing pipeline, and the callback subprocess decodes
SyncCallback kwargs right before calling the user callable.

Executor callback data now carries a "kwargs_encoding" marker so the
worker only decodes encoded kwargs, callbacks created before upgrade run
unchanged, and an older Task SDK fails such callbacks instead of passing
encoded arguments.

The runtime-provided callback context is serialized strictly, as before;
only the stored callback kwargs keep their encoded form.

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

  • Render deadline callback kwargs readably in metrics and repr

Deadline callback kwargs are now kept in their encoded form, so metric tags and the callback repr showed the raw encoding instead of the values. Show them in a readable form again, without importing or building anything they name.

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

  • Keep deadline callback kwargs display total for non-finite intervals

A timedelta payload holding NaN made the display of callback kwargs raise, which would escape from metric emission and the callback repr. Show such values, and any other interval that cannot be built, in the generic form instead.

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

  • Assert that the deadline context never reaches the triggerer, not how it is refused

The triggerer-path deadline test pinned the AttributeError raised by
strict serialization. Assert the outcome instead (no trigger is created
and nothing in the context is constructed), so the test holds whether
the context is refused by raising or by failing the callback.

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

  • Fail only the affected trigger when its kwargs cannot be decoded
    (cherry picked from commit 233f9c3)

Co-authored-by: Jarek Potiuk jarek@potiuk.com
Generated-by: Claude Opus 5

…74830)

* Decode deadline callback kwargs where the callback runs

Deadline Alert callback kwargs were decoded in the scheduler and the API
server whenever deadline alerts were loaded, although neither component
calls the callback. Keep the kwargs serde-encoded on the server and
decode them where they are used: the triggerer decodes AsyncCallback
kwargs with its existing pipeline, and the callback subprocess decodes
SyncCallback kwargs right before calling the user callable.

Executor callback data now carries a "kwargs_encoding" marker so the
worker only decodes encoded kwargs, callbacks created before upgrade run
unchanged, and an older Task SDK fails such callbacks instead of passing
encoded arguments.

The runtime-provided callback context is serialized strictly, as before;
only the stored callback kwargs keep their encoded form.

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

* Render deadline callback kwargs readably in metrics and repr

Deadline callback kwargs are now kept in their encoded form, so metric tags and the callback repr showed the raw encoding instead of the values. Show them in a readable form again, without importing or building anything they name.

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

* Keep deadline callback kwargs display total for non-finite intervals

A timedelta payload holding NaN made the display of callback kwargs raise, which would escape from metric emission and the callback repr. Show such values, and any other interval that cannot be built, in the generic form instead.

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

* Assert that the deadline context never reaches the triggerer, not how it is refused

The triggerer-path deadline test pinned the AttributeError raised by
strict serialization. Assert the outcome instead (no trigger is created
and nothing in the context is constructed), so the test holds whether
the context is refused by raising or by failing the callback.

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

* Fail only the affected trigger when its kwargs cannot be decoded
(cherry picked from commit 233f9c3)

Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
Generated-by: Claude Opus 5
@potiuk
potiuk marked this pull request as ready for review October 19, 2026 16:46
@potiuk
potiuk merged commit 88801da into v3-4-test Oct 19, 2026
96 of 97 checks passed
@potiuk
potiuk deleted the backport-233f9c3-v3-4-test branch October 19, 2026 16:46
@github-actions github-actions Bot added this to the Airflow 3.4.1 milestone Oct 19, 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.4.1 based on: 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 Oct 20, 2026
…74830) (#75114)

* Decode deadline callback kwargs where the callback runs

Deadline Alert callback kwargs were decoded in the scheduler and the API
server whenever deadline alerts were loaded, although neither component
calls the callback. Keep the kwargs serde-encoded on the server and
decode them where they are used: the triggerer decodes AsyncCallback
kwargs with its existing pipeline, and the callback subprocess decodes
SyncCallback kwargs right before calling the user callable.

Executor callback data now carries a "kwargs_encoding" marker so the
worker only decodes encoded kwargs, callbacks created before upgrade run
unchanged, and an older Task SDK fails such callbacks instead of passing
encoded arguments.

The runtime-provided callback context is serialized strictly, as before;
only the stored callback kwargs keep their encoded form.

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

* Render deadline callback kwargs readably in metrics and repr

Deadline callback kwargs are now kept in their encoded form, so metric tags and the callback repr showed the raw encoding instead of the values. Show them in a readable form again, without importing or building anything they name.

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

* Keep deadline callback kwargs display total for non-finite intervals

A timedelta payload holding NaN made the display of callback kwargs raise, which would escape from metric emission and the callback repr. Show such values, and any other interval that cannot be built, in the generic form instead.

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

* Assert that the deadline context never reaches the triggerer, not how it is refused

The triggerer-path deadline test pinned the AttributeError raised by
strict serialization. Assert the outcome instead (no trigger is created
and nothing in the context is constructed), so the test holds whether
the context is refused by raising or by failing the callback.

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

* Fail only the affected trigger when its kwargs cannot be decoded
(cherry picked from commit 233f9c3)


Generated-by: Claude Opus 5

Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants