Fix deadline callback data persistence#69073
Open
shivaam wants to merge 1 commit into
Open
Conversation
Contributor
Author
|
@ferruzzi I split this out from #68961 based on your suggestion. This PR is intentionally scoped to the independent 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Split out from #68961.
Deadline.handle_miss()adds deadline context and executor routing fields tocallback.data, then persists the callback row. The current code mutates nested JSON in place, so SQLAlchemy may not mark theExtendedJSONpayload dirty. That leaves reloaded callback rows without the data the scheduler expects, such asdag_run_idfor 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:
Validation:
main, the sync/executor deadline callback row was marked queued but the persistedcallback.datalacked the routing/context fields. With this patch, the sync callback row persisteddag_run_id,deadline_id, and context, and the callback marker was written.