kaxil opened a new pull request, #64598:
URL: https://github.com/apache/airflow/pull/64598
## Summary
- Workers on task-sdk < 1.2 crash with `KeyError: __var` when resuming
deferred tasks whose trigger has fired on a 3.2 server
- Add a Cadwyn response converter on `TIRunContext` that wraps `next_kwargs`
in BaseSerialization format for old API versions
## Context
After #59711 switched trigger kwargs to SDK serde, `handle_event_submit`
re-serializes `next_kwargs` as plain dicts. Old workers only know
`BaseSerialization.deserialize()`, which requires `{"__type": "dict", "__var":
{...}}` wrapping on all dicts -- so they crash with `KeyError: __var`.
This was [flagged during review of
#59711](https://github.com/apache/airflow/pull/59711#discussion_r2650977380) --
the compat shim was added for the deserialize path but not the serialize path.
## Approach
Instead of changing `trigger.py` to use `BaseSerialization.serialize()`
(which regresses the DB to old format), the fix adds a response converter in
the Execution API versioning layer (`ModifyDeferredTaskKwargsToJsonValue`).
This:
- Keeps the DB in SDK serde format (the direction we're moving)
- Translates at the API boundary for old workers -- consistent with how all
other backward-compat changes work via Cadwyn
- Short-circuits when data already has `__type`/`__var` keys (rolling
upgrade with old data in DB)
- Gets removed automatically when old API versions are dropped
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]