Repository navigation
[Async stack 0/6] Async orchestrator contract - #356
andystaples wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The documentation incorrectly implies synchronous commands are awaitable, which can cause a TypeError after scheduling an action; it should explicitly state that these commands must be called without await.
1 open issue
What changed in this PR
This documentation-only PR defines the async orchestrator contract for the core SDK, Azure Managed, and Azure Functions. It establishes behavior that later layers of the review-only stack will implement.
Changes:
- Describe coroutine authoring, cold operations, reusable handles, and Functions compatibility.
- Specify deterministic asyncio composition, cancellation, timeouts, and dispatch cleanup.
- Document replay migration constraints and Python-runtime compatibility limits.
| File | Description |
|---|---|
docs/supported-patterns.md |
Connects durable patterns to async authoring and clarifies root cancellation behavior. |
docs/features.md |
Introduces coroutine orchestrators alongside generator orchestrators. |
docs/async-orchestrators.md |
Defines the cross-package async contract and replay constraints. |
Review effort: Balanced
b420f99 to
73cac11
Compare
| @@ -0,0 +1,296 @@ | |||
| # Async orchestrators | |||
|
|
|||
| All three packages accept native `async def` orchestrators alongside existing | |||
There was a problem hiding this comment.
Open question (resolve before merge): should async orchestrators ship as preview?
This change adds async orchestrators without a preview or experimental label. Two things could still change after release:
- The public surface: the cold
AsyncOrchestrationContextversus eager handles viaas_task_context(). - Replay behavior that depends on the Python minor version (Document Python runtime compatibility and safe upgrade guidance for durable orchestrations #337): Python 3.11 and 3.12+ record different histories for
asyncio.wait_for.
Should core and durabletask.azuremanaged label async orchestrators as preview in the docs and changelogs until those settle, or ship them as generally available? Please answer and resolve this thread before the stack merges.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…rnings Add motivation, goals, non-goals, and alternatives considered; document the orchestrator classification rule and that operation inputs are not copied; promote the unsupported asyncio.wait/as_completed, dispatch-teardown, and Python minor-version replay notes to callouts. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
bea1c8e to
54eb8f1
Compare
Bernd Verst (berndverst)
left a comment
There was a problem hiding this comment.
Approved as the contract layer, not as a standalone merge. The distinction between starting work and waiting for it, and between dispatch cleanup and workflow cancellation, is useful. I'd ship the documented subset as preview across core, Managed, and Functions, and use representative history replay and a native Pydantic adapter sample as the bar for full support. The rollout note should make clear that versioning only protects existing histories when workers route them to a compatible runtime.
| > can change durable action order inside concurrent branches, and the async | ||
| > context does not normalize arbitrary standard-library scheduling. Keep the | ||
| > Python minor version (and dependencies) fixed for in-flight instances; drain | ||
| > or version affected instances before upgrading. See |
There was a problem hiding this comment.
An orchestration version bump alone won't protect a history written on Python 3.11 if a worker on another minor version can replay it. A mixed-minor replay probe hit an action-order mismatch at the first activity. Please say to either drain existing instances before upgrading or keep them routed to workers pinned to the original runtime and dependencies throughout the rollout.

Warning
Neither this PR nor any other PR in this stack should be merged on its own. The whole stack will be squash-merged once every PR in it is approved.
This is the contract-documentation layer (0/6) of a review-only stack that splits the closed #293. The APIs documented here are implemented in later layers; this PR changes documentation only. Later layers extend
docs/async-orchestrators.mdas they implement each area, and the final version of the contract is in #364.asyncio.wait/asyncio.as_completedare documented as unsupported), and migration and Python-runtime compatibility limits, including keeping the Python minor version fixed for in-flight instances (Document Python runtime compatibility and safe upgrade guidance for durable orchestrations #337).Differences from #293
The stack adds 5,488 lines and removes 126, compared with 4,669 added and 99 removed in #293, so it adds roughly 820 more lines. Most of the difference is hardening:
durabletask/internal/asyncio_loop.py).Any-typed overload for async sub-orchestration calls withoutreturn_type.