Skip to content

Add ADR for Lang SDK Dag and mixed-language Task processing flow - #71929

Merged
jason810496 merged 9 commits into
apache:mainfrom
jason810496:feature/lang-sdk/adr-0007-mixed-language-dag-processing
Sep 29, 2026
Merged

jason810496 merged 9 commits into
apache:mainfrom
jason810496:feature/lang-sdk/adr-0007-mixed-language-dag-processing

Conversation

@jason810496

@jason810496 jason810496 commented Aug 21, 2026 •

Copy link
Copy Markdown
Member
  • related: AIP-108, AIP-85 Design only, no code changes.

  • Design how the DagImporter interface and the Coordinator interface works together for the native Dag processing.

  • Design how the mixed language task validation works in the Dag processing path.


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

@jason810496
jason810496 force-pushed the feature/lang-sdk/adr-0007-mixed-language-dag-processing branch from 6324a01 to ca8ebdd Compare August 21, 2026 11:04
Comment thread airflow-core/adr/lang-sdk/README.md Outdated
Comment thread airflow-core/adr/lang-sdk/0008-mixed-language-dag-processing.md Outdated
@jason810496 jason810496 self-assigned this Aug 23, 2026

@jason810496 jason810496 left a comment •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Here're the feedbacks suggested by TP from the offline sync:

  • The Lang SDK user interface should be different for the mixed Lang Dag case (e.g. ExternalDag, MixedLangDag or TaskBuilder instead of DagBuilder etc.)
  • Don't treat the mixed Lang Dag artifact same as the native Dag atifact.
  • Instead of introducing the is_mixed_language Dag-level argument, we need to adjust the DagFileParsingRequest to make the runtime subprocess propagate the mixed Lang Dag only list.

@jason810496
jason810496 marked this pull request as draft August 24, 2026 08:43
@jason810496
jason810496 marked this pull request as ready for review August 25, 2026 08:28
@jason810496
jason810496 force-pushed the feature/lang-sdk/adr-0007-mixed-language-dag-processing branch from 65bff0b to 72aaf57 Compare August 25, 2026 08:31
@jason810496
jason810496 requested a review from uranusjr August 25, 2026 08:31

@jason810496 jason810496 left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Hi @uranusjr,
I just refined the ADR based on the our discussion yesterday.

  • Replace the Dag-level is_mixed_language_dag by introducing differences at the user authoring interface level (@Dag vs @MixedLangDag in the case of Java SDK)
  • Add mixed_language_dags_only field on the DagFileParseRequest
  • Replace the JavaDagImporter for the mixed lang with the existing bundle discovery method plus the JavaCoordinator.run_dag_parsing

Please let me know WDYT when you have a moment, thanks.

@jason810496
jason810496 marked this pull request as draft September 8, 2026 07:51
@jason810496
jason810496 force-pushed the feature/lang-sdk/adr-0007-mixed-language-dag-processing branch from 72aaf57 to 0220ce7 Compare September 13, 2026 14:34
@jason810496 jason810496 changed the title Add ADR-0008 for mixed-language Dag processing flow Add ADR for Lang SDK Dag and mixed-language Task processing flow Sep 14, 2026
@jason810496
jason810496 marked this pull request as ready for review September 14, 2026 06:10
@uranusjr

uranusjr commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

0008 is already taken now. We’ll need to update the PR to use the next free number. Currently 0010 would be the most natural sine 0009 is also already taken.

A Lang-SDK artifact backing `@task.stub` tasks used to author a Dag under the
same dag_id the Python file already owns, so two conflicting definitions
reached persistence and something downstream had to pick between them. Removing
the Dag from the authoring interface answers that once, rather than leaving
every consumer of a serialized Dag to ask whether the Dag in front of it is
real.

Terms follow the Language SDK spec so the decision reads the same in Go, Java,
and TypeScript, and the parse-side contract is grounded in the shipped
coordinator and supervisor-schema code rather than in a proposed shape.
…nics

An ADR is read first to understand what was decided and why, and only later to
build the thing. Exact message shapes, call sites, and the code that has to
change were interleaved with that reasoning, so neither audience could skim its
half. The decisions now stand on their own and the mechanics wait in an
appendix.
The single document answered three questions with different audiences and
different review cycles: the wire protocol a runtime implements, how a Lang-SDK
Dag source reaches the Dag processor, and how a Python stub is validated
against the handler behind it. Readers had to take all three to act on one, and
a change to any one of them forced the other two back through review.
The diagrams carry the decision faster than the prose around them did, so they
belong where a reader lands rather than behind an appendix. The argument for
each choice is still worth keeping, but it is what someone reads second.

Coordinator lookup gains a named answer: for_bundle, beside the existing
for_queue, rather than an open question about how a registry finds the
coordinators serving a bundle.
…oint

An earlier draft gave task-handler parsing its own message pair on the
theory that the runtime answered the coordinator. It does not: the
coordinator forwards bytes and decodes nothing, so the peer is whichever
process started the parse. Two reply unions would have meant two decoder
configurations and two relay paths for identical traffic.

Validation likewise had no home. It needs the parsed Dags and the
argument bindings that only exist after serialization, and the only place
holding both is the Dag-file parse itself — not an importer, which should
not have to know what a coordinator or a queue is.

Making a coordinator's importer optional restated in a return type what
the artifact source already decides, leaving two answers free to
disagree.
A reader meeting native Dag processing and mixed-language handlers for
the first time needs to know what each one decides before the message
shapes and subprocess classes that carry them mean anything. The parse
protocol is the mechanics both decisions share, so it reads better after
them than in front of them.
@jason810496
jason810496 force-pushed the feature/lang-sdk/adr-0007-mixed-language-dag-processing branch from af9fe9c to f684ee0 Compare September 29, 2026 01:33
@jason810496

jason810496 commented Sep 29, 2026 •

Copy link
Copy Markdown
Member Author

0008 is already taken now. We’ll need to update the PR to use the next free number. Currently 0010 would be the most natural sine 0009 is also already taken.

I just updated the numbers, thanks.

Comment thread airflow-core/adr/lang-sdk/0011-mixed-language-dag-processing.md Outdated
Comment thread airflow-core/adr/lang-sdk/0012-lang-sdk-parse-protocol.md

@jason810496 jason810496 left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thanks TP for the review and the discussion.

Comment thread airflow-core/adr/lang-sdk/0011-mixed-language-dag-processing.md Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants