Skip to content

Fix deadline callback data persistence#69073

Open
shivaam wants to merge 1 commit into
apache:mainfrom
shivaam:codex/airflow-deadline-callback-persistence
Open

Fix deadline callback data persistence#69073
shivaam wants to merge 1 commit into
apache:mainfrom
shivaam:codex/airflow-deadline-callback-persistence

Conversation

@shivaam

@shivaam shivaam commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Split out from #68961.

Deadline.handle_miss() adds deadline context and executor routing fields to callback.data, then persists the callback row. The current code mutates nested JSON in place, so SQLAlchemy may not mark the ExtendedJSON payload dirty. That leaves reloaded callback rows without the data the scheduler expects, such as dag_run_id for executor callbacks.

This updates handle_miss() to reassign the callback data payload when adding context/routing fields. It also stores the deadline id in callback context as a string so triggerer callback kwargs stay serialization-safe.

Tests added:

  • commit/reload coverage for triggerer callback context persistence
  • commit/reload coverage for executor callback routing data persistence

Validation:

  • Unit tests that will fail without the fix.
  • I also checked this with a local real Airflow/Postgres daemon harness. On upstream main, the sync/executor deadline callback row was marked queued but the persisted callback.data lacked the routing/context fields. With this patch, the sync callback row persisted dag_run_id, deadline_id, and context, and the callback marker was written.

@shivaam

shivaam commented Jun 27, 2026

Copy link
Copy Markdown
Contributor Author

@ferruzzi I split this out from #68961 based on your suggestion. This PR is intentionally scoped to the independent Deadline.handle_miss() callback data persistence bug, without changing the failure-time Deadline Alert behavior.

The larger PR can then be reworked separately around an opt-in failure behavior flag for users who want Deadline Alerts to fire when a DagRun fails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:deadline-alerts AIP-86 (former AIP-57)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant