Skip to content

TS SDK: reject a Dag whose order-only edges form a cycle - #73440

Closed
jason810496 wants to merge 2 commits into
apache:mainfrom
jason810496:feature/ts-sdk/dag-cycle-detection
Closed

jason810496 wants to merge 2 commits into
apache:mainfrom
jason810496:feature/ts-sdk/dag-cycle-detection

Conversation

@jason810496

@jason810496 jason810496 commented Sep 21, 2026 •

Copy link
Copy Markdown
Member

TS SDK: reject a Dag whose order-only edges form a cycle

Why

A cycle through arguments cannot be written: a reference exists only once its producing call has returned. before and after join two references that already exist, so they can form one, and Airflow would reject the Dag long after the author left.

How

  • An iterative three-colour DFS over the combined graph — wiring edges and order-only edges together — run when the Dag is read.
  • The error names the tasks on the cycle, in order, so the edge to remove is visible without redrawing the graph.
  • The check sees through groups: a group edge stands for every task the group holds, nested groups included.

What

  • src/sdk/cycle.ts, and the check in the Dag's own close step.

Was generative AI tooling used to co-author this PR?

@jason810496
jason810496 force-pushed the feature/ts-sdk/dag-cycle-detection branch from 031fa1e to 160385e Compare September 30, 2026 02:31
@jason810496

jason810496 commented Sep 30, 2026 •

Copy link
Copy Markdown
Member Author

Closing: cycle validation moves to the core side, where the Dag processor receives the Dags a language SDK sends, so the TypeScript SDK does not need its own check. #73441 now builds directly on #73439.

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