Skip to content

Add Lang SDK ADRs for callbacks, deadline alerts and listeners - #77771

Open
jason810496 wants to merge 9 commits into
apache:mainfrom
jason810496:feature/lang-sdk/callbacks-listeners-adr
Open

jason810496 wants to merge 9 commits into
apache:mainfrom
jason810496:feature/lang-sdk/callbacks-listeners-adr

Conversation

@jason810496

@jason810496 jason810496 commented Nov 30, 2026 •

Copy link
Copy Markdown
Member

These ADRs set the design of callbacks, deadline alerts and listeners for Dags written with the TypeScript, Go and Java SDKs, and the core changes they need. They build on the Python sidecar and the python module from #77582.

Decisions:

  • A Lang SDK Dag's Dag and task callbacks are SDK functions or Python references (python.callbackRef), which run on the same queue. The runtime runs a task's callbacks when the task ends, within [core] task_success_overtime. Their context follows ADR-0018's ti.dagRun shape.
  • Callbacks for interrupted tasks, Dag runs and deadline alerts go through a new execute_callback on the coordinator. Each request gets its own startup message, and the runtime picks the callables by state.
  • A task callback runs on its task's queue. A Dag callback and an SDK-function deadline callback run on the Dag's queue, which each SDK writes as default_args.queue. They never fall back to the team's default queue.
  • A deadline alert takes a built-in reference or python.deadlineReferenceRef(path, kwargs). Its callback can be an SDK function, a sync Python reference or an async Python reference.
  • Listeners stay Python. The task instance hooks run in the Python sidecar, and their errors and timeouts never fail the task.
  • Lang SDK tasks get no email fields, and stub TaskHandlers get no task callbacks for now. A Python Dag with stub TaskHandlers keeps its Dag callbacks.

Core changes:

  • New supervisor messages: dedicated callback startup schemas, and TaskStarted, which carries the task metadata that listeners such as OpenLineage read.
  • The scheduler routes a Lang SDK Dag's callbacks to the task's queue or the Dag's default_args.queue.
  • TaskState and RetryTask gain an optional error.
  • A new DeadlineAlertCallback with the deadline_alert fetch method, and a deadline variant of the callback context endpoint.

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

Generated-by: Claude Code (Opus 5.5) following the guidelines

@jason810496
jason810496 marked this pull request as draft December 1, 2026 01:51
…outs

Drop task emails from the SDKs in favor of SmtpNotifier, follow ADR-0018's
nested ti.dagRun shape, carry the deadline alert name in its envelope with
its own decoder allowlist, send listener metadata in TaskStarted, give user
hooks a non-fatal sidecar timeout, take Python's missing-Dag path for a
failed stub start, and gate execute_callback on the schema version.

Co-Authored-By: Claude <noreply@anthropic.com>
@jason810496
jason810496 marked this pull request as ready for review December 1, 2026 07:26

@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 Kaxil for the review!

@jason810496
jason810496 requested a review from kaxil December 1, 2026 07:29
@jason810496
jason810496 marked this pull request as draft December 2, 2026 11:05
@jason810496
jason810496 force-pushed the feature/lang-sdk/callbacks-listeners-adr branch 3 times, most recently from d514e28 to 8097322 Compare December 3, 2026 04:54
…cope

Task callbacks use the task's queue, and Dag and SDK-function deadline
callbacks use the Dag's queue, which each SDK writes as default_args.queue.
Dag and task callbacks of a Lang SDK Dag are SDK functions or Python
references, which run in the same runtime run and so on the same queue.
Stub TaskHandlers get no task callbacks for now.

Co-Authored-By: Claude <noreply@anthropic.com>
@jason810496
jason810496 force-pushed the feature/lang-sdk/callbacks-listeners-adr branch from 8097322 to a0cacee Compare December 3, 2026 08:59
@jason810496
jason810496 marked this pull request as ready for review December 3, 2026 09:12
@jason810496
jason810496 requested a review from uranusjr December 3, 2026 09:12

This branch has not been deployed

No deployments
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.

3 participants