Skip to content

Fix Dags with deadlines failing to parse after a database retry - #71628

Closed
ephraimbuddy wants to merge 1 commit into
apache:mainfrom
astronomer:fix-deadline-dag-parse-retry
Closed

ephraimbuddy wants to merge 1 commit into
apache:mainfrom
astronomer:fix-deadline-dag-parse-retry

Conversation

@ephraimbuddy

Copy link
Copy Markdown
Contributor

Writing a Dag with a deadline rewrites its serialized deadline entries from definitions into UUID references, and it did so on the object the caller passed in. When update_dag_parsing_results_in_db hit a transient database error it rolled back and retried the same objects, which by then held UUID strings where definitions were expected. The retry raised AttributeError while re-encoding them, and since that is not a database error it escaped the retry entirely, so the manager discarded the whole file's parse results rather than one Dag's.

Rewrite a copy instead. Only the "dag" sub-dict is copied, so the bulk of the serialized structure is still shared, and the Dag the caller holds stays in the shape it arrived in however many times the write is attempted.


Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

Generated-by: Claude Opus 5 following the guidelines

A transient database error while persisting a Dag with deadlines could turn a recoverable retry into a serialization failure. The Dag processor then discarded the file's parse results, making otherwise valid Dags disappear until a later successful parse.
@ephraimbuddy
ephraimbuddy force-pushed the fix-deadline-dag-parse-retry branch from 75aa479 to 2d5f8a7 Compare August 15, 2026 16:31
@ephraimbuddy ephraimbuddy self-assigned this Aug 24, 2026

@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.

LGTM, nice catch

@ephraimbuddy

Copy link
Copy Markdown
Contributor Author

Closing this as #70148 fixed same issue and is merged now

@ferruzzi

Copy link
Copy Markdown
Contributor

To be fair, I think your tests are more thorough and still worth saving, but the bug itself is fixed.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants