Repository navigation
[Async stack 6/6] Document coroutine orchestrators and add Managed compatibility tests - #364
Conversation
1df84a9 to
88e2d24
Compare
88e2d24 to
510dc24
Compare
510dc24 to
818c9e2
Compare
Rebased onto main as a single commit. Includes: - Document coroutine orchestrators and add Managed compatibility tests - Clarify async migration joins and cover in-memory provider cases - Consolidate async changelog entries and gate Managed coroutine tests - Document the native async shape and call_http for Functions - Disclose the generator first-yield check and make async migration snippets runnable Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the coroutine documentation and Managed compatibility test updates.
No open issues 🎉
What changed in this PR
This final layer of the async-orchestrator stack documents coroutine support across all three SDK packages and adds Managed compatibility tests. It includes no SDK source, version, or dependency changes and must be merged with the complete stack.
Changes:
- Documents two-argument async orchestrators, durable HTTP, supported composition, and replay/migration constraints.
- Adds cross-worker gRPC tests for mixed generator/coroutine orchestrations, with optional DTS-backed coverage.
- Adds changelog entries and wires in-memory Managed tests into Nox and the official build.
| File | Description |
|---|---|
tests/durabletask-azuremanaged/test_dts_coroutine_orchestrators.py |
Adds core and Managed coroutine compatibility tests. |
README.md |
Introduces async authoring and key execution constraints. |
noxfile.py |
Adds in-memory compatibility cases to the Managed test session. |
eng/templates/build.yml |
Runs in-memory Managed cases without an emulator. |
durabletask-azuremanaged/CHANGELOG.md |
Records Managed async support and core release requirements. |
docs/async-orchestrators.md |
Updates Functions guidance to the two-argument async shape and df.call_http. |
CHANGELOG.md |
Records core async support, replay warnings, and first-yield validation changes. |
azure-functions-durable/README.md |
Documents async composition, durable HTTP, and replay execution. |
azure-functions-durable/MIGRATION_GUIDE.md |
Explains native async migration, joins, races, and HTTP mapping. |
azure-functions-durable/CHANGELOG.md |
Records Functions async support and the durable HTTP helper. |
Review effort: Balanced
fc59e38 to
2163808
Compare
Bernd Verst (berndverst)
left a comment
There was a problem hiding this comment.
Approved for this docs and Managed test layer only; the runtime issues on the earlier PRs still block the stack. The docs describe one native async signature across the SDKs, and the Managed smoke tests exercise mixed generator and coroutine workflows. Please clarify who owns the losing handle in the approval example, and align #294 with the two-argument Functions scope before closing it. The smoke tests don't establish mixed-runtime replay or native Pydantic compatibility.
| return winner is approved and approved.get_result() | ||
| ``` | ||
|
|
||
| Losing handles are not cancelled; retain and join them when their completion |
There was a problem hiding this comment.
Please show what to do when the losing receive is no longer needed. If the timer wins and the workflow goes on to wait for approval again, the old eager waiter is still first in line and consumes the next event. Cancel the abandoned event handle (and cancel the deadline when approval wins), or point readers to ctx.wait_for_external_event(..., timeout=...) for this pattern. This example returns immediately, so the issue shows up when readers extend it.
Warning
This PR is part of a review-only stack and must not be merged individually. The whole stack will be squash-merged after every PR in it is approved.
Stacked on #363. Final layer (6/6) of the coroutine (
async def) orchestrator stack. Resolves #294Changes
README.md,docs/async-orchestrators.md, andazure-functions-durable/README.md.task.AsyncOrchestrationContext. Single-parameterasync deforchestrators are unsupported and raiseTypeErrorwhen registered.asyncio.gatherorasyncio.TaskGroup. Races usectx.as_task_context()handles withtask.when_any.df.call_httpfor durable HTTP requests from async and generator durabletask contexts.azure-functions-durable/MIGRATION_GUIDE.mddescribes the native async shape, adds thecontext.call_http→df.call_httpmapping, and covers async composition with self-contained gather and race examples.## UnreleasedADDED entry each for the core SDK,durabletask.azuremanaged, andazure-functions-durable. The core entry includes a replay and Python-version warning. The core changelog also adds a CHANGED entry: a generator orchestrator whose firstyieldis not adurabletask.Tasknow fails on its first dispatch withTypeError. Previously a bare firstyieldleft the instance pending indefinitely, and a non-Taskfirst yield scheduled its work and then failed later withAttributeError.tests/durabletask-azuremanaged/test_dts_coroutine_orchestrators.py, which runs coroutine orchestrators through the Durable Task Scheduler worker/client. Cases run against in-memory gRPC for both core and Managed types; DTS-backed variants are markeddtsand readENDPOINT/TASKHUBwith emulator defaults.CI
eng/templates/build.ymlruns the in-memory (not dts) cases of the new Managed test file in the official build, which has no emulator.azuremanaged_testsnox session (used by the GitHub Actions Managed workflow) also runs those in-memory cases, so they gate pull requests as well as the official build.No source, version, or dependency changes are included in this layer.