Skip to content

Fix deadline callback data persistence - #69073

Merged
eladkal merged 3 commits into
apache:mainfrom
shivaam:codex/airflow-deadline-callback-persistence
Jul 2, 2026
Merged

eladkal merged 3 commits 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 requested review from XD-DENG and ashb as code owners June 27, 2026 02:43
@boring-cyborg boring-cyborg Bot added the area:deadline-alerts AIP-86 (former AIP-57) label Jun 27, 2026
@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.

@ferruzzi ferruzzi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for splitting it; this looks like a legit bug, no point trapping it while we discuss the other part.

@eladkal eladkal added this to the Airflow 3.3.1 milestone Jul 1, 2026
@shivaam

shivaam commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

@o-nikolas If you get time, would you be able to review this PR?

@eladkal eladkal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@eladkal
eladkal merged commit 57cff7c into apache:main Jul 2, 2026
77 checks passed
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Backport successfully created: v3-3-test

Note: As of Merging PRs targeted for Airflow 3.X
the committer who merges the PR is responsible for backporting the PRs that are bug fixes (generally speaking) to the maintenance branches.

In matter of doubt please ask in #release-management Slack channel.

Status Branch Result
✅ v3-3-test PR Link

github-actions Bot pushed a commit to aws-mwaa/upstream-to-airflow that referenced this pull request Jul 2, 2026
* Fix deadline callback data persistence

* Clarify deadline callback data updates
(cherry picked from commit 57cff7c)

Co-authored-by: Shivam Rastogi <6463385+shivaam@users.noreply.github.com>
aws-airflow-bot pushed a commit to aws-mwaa/upstream-to-airflow that referenced this pull request Jul 2, 2026
* Fix deadline callback data persistence

* Clarify deadline callback data updates
(cherry picked from commit 57cff7c)

Co-authored-by: Shivam Rastogi <6463385+shivaam@users.noreply.github.com>
vatsrahul1001 pushed a commit that referenced this pull request Jul 3, 2026
* Fix deadline callback data persistence

* Clarify deadline callback data updates
(cherry picked from commit 57cff7c)

Co-authored-by: Shivam Rastogi <6463385+shivaam@users.noreply.github.com>
vatsrahul1001 pushed a commit that referenced this pull request Jul 3, 2026
* Fix deadline callback data persistence

* Clarify deadline callback data updates
(cherry picked from commit 57cff7c)

Co-authored-by: Shivam Rastogi <6463385+shivaam@users.noreply.github.com>
jason810496 pushed a commit to jason810496/airflow that referenced this pull request Jul 7, 2026
…ache#69259)

* Fix deadline callback data persistence

* Clarify deadline callback data updates
(cherry picked from commit 57cff7c)

Co-authored-by: Shivam Rastogi <6463385+shivaam@users.noreply.github.com>
@potiuk potiuk added the ready for maintainer review Set by triage when all criteria pass, or by the fork CI reconciler when fork CI is green. label Jul 8, 2026
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) ready for maintainer review Set by triage when all criteria pass, or by the fork CI reconciler when fork CI is green. type:bug-fix Changelog: Bug Fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants