Repository navigation
Add the resume event to stored next_kwargs without decoding them - #73576
Conversation
handle_event_submit only needs to add the trigger event to a task
instance's stored next_kwargs. It previously decoded the whole stored
payload, added the event and re-encoded everything, reconstructing every
stored value in the scheduler, triggerer and API server although only the
worker ever needs those objects.
Merge the serialized event into the stored serialized dict instead. Stored
values pass through untouched; payloads that are not a dict at the top
level still fail the task instance rather than resuming it. Rows still in
the legacy {"__type": "dict", "__var": ...} shape keep that shape.
Generated-by: Claude Opus 5
|
@ashb @amoghrajesh — gentle reminder: this needs a review to make the 3.4.0 cut on 2026-10-19. CI is green and it's ready from my side. |
|
@uranusjr @amoghrajesh Could you take a look at this when you have a moment? It's targeted at 3.4.0 and needs a review to make the cut on 2026-10-19. CI is green. |
Generated-by: Claude Opus 5
There was a problem hiding this comment.
Looks good to me. Stored values are carried over encoded and the legacy form keeps its encoding. The worker already falls back to BaseSerialization.deserialize for legacy rows, and the tests check that nothing is constructed during event submission. Could use reviews from @uranusjr @amoghrajesh before merging.
Backport successfully created: v3-4-testNote: As of Merging PRs targeted for Airflow 3.X In matter of doubt please ask in #release-management Slack channel.
|
…ng them (#73576) (#75116) * Add the resume event to stored next_kwargs without decoding them handle_event_submit only needs to add the trigger event to a task instance's stored next_kwargs. It previously decoded the whole stored payload, added the event and re-encoded everything, reconstructing every stored value in the scheduler, triggerer and API server although only the worker ever needs those objects. Merge the serialized event into the stored serialized dict instead. Stored values pass through untouched; payloads that are not a dict at the top level still fail the task instance rather than resuming it. Rows still in the legacy {"__type": "dict", "__var": ...} shape keep that shape. Generated-by: Claude Opus 5 * Fail the task when a legacy resume event cannot be serialized (cherry picked from commit 1117472) Generated-by: Claude Opus 5 Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
…ng them (#73576) (#75116) * Add the resume event to stored next_kwargs without decoding them handle_event_submit only needs to add the trigger event to a task instance's stored next_kwargs. It previously decoded the whole stored payload, added the event and re-encoded everything, reconstructing every stored value in the scheduler, triggerer and API server although only the worker ever needs those objects. Merge the serialized event into the stored serialized dict instead. Stored values pass through untouched; payloads that are not a dict at the top level still fail the task instance rather than resuming it. Rows still in the legacy {"__type": "dict", "__var": ...} shape keep that shape. Generated-by: Claude Opus 5 * Fail the task when a legacy resume event cannot be serialized (cherry picked from commit 1117472) Generated-by: Claude Opus 5 Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
handle_event_submitonly needs to add the trigger event to a task instance's storednext_kwargs. It previously decoded the whole stored payload, added the event, andre-encoded everything — which reconstructs every stored value in the scheduler,
triggerer and API server, although only the worker ever needs those objects.
This merges the serialized event into the stored serialized dict instead. Stored values
pass through untouched (the worker deserializes them as before); payloads that are not
a dict at the top level still fail the task instance rather than resuming it. Rows still
in the legacy
{"__type": "dict", "__var": ...}shape keep that shape.Test plan:
object is never constructed during event submission
airflow-core/tests/unit/models/test_trigger.pypassesWas generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Opus 5.5) following the guidelines at
https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions