Title: [Async stack 2/6] asyncio composition by andystaples · Pull Request #359 · microsoft/durabletask-python · GitHub
Open Graph Title: [Async stack 2/6] asyncio composition by andystaples · Pull Request #359 · microsoft/durabletask-python
X Title: [Async stack 2/6] asyncio composition by andystaples · Pull Request #359 · microsoft/durabletask-python
Description: WarningDo not merge this PR, or any other PR in this stack, on its own. The stack exists only to make review easier. Once every PR in the stack is approved, the whole stack will be squash-merged together. Part of the reviewability stack split from #293. This PR is based on the coroutine-dispatch layer (#357). Scope This PR extends the deterministic orchestration event loop in durabletask/internal/asyncio_loop.py. It adds support for standard asyncio composition primitives inside async orchestrators: Tasks: create_task returns a _DurableAsyncTask that is retired when it completes, so finished tasks and their payloads are released. Deterministic ready queue: call_soon keeps FIFO order. While a task is being cancelled, callbacks scheduled during that cancellation are ordered deterministically. This keeps TaskGroup cancellation, and the durable actions it produces, stable across replays. Durable timers: call_later and call_at are backed by durable timers through _DurableTimerHandle. Non-finite delays are rejected. Past deadlines go straight to the ready queue. Deadlines are rounded up to the timer resolution so a callback never fires early. Cancelling a handle also cancels its durable timer. Handles are compared by identity, so identical callbacks scheduled at the same time stay independent. As a result, asyncio.sleep, asyncio.wait_for, asyncio.timeout, asyncio.gather, and asyncio.TaskGroup work inside async orchestrators. Review focus Ordering rules for call_soon versus cancellation callbacks, and the durable actions they produce. Deadline rounding, and how cancelling a timer handle interacts with its durable timer. Whether local task cancellation stops a waiter without cancelling durable work that other waiters still share. Deferred to later layers Dispatch teardown: closing the loop, async-generator finalization, the cleanup-error policy, and guards for unsupported I/O and executors. Cold context: the AsyncOrchestrationContext API surface. Azure Functions integration and release notes. The tests in this layer use the existing OrchestrationContext APIs. Later layers move them to the async context.
Open Graph Description: WarningDo not merge this PR, or any other PR in this stack, on its own. The stack exists only to make review easier. Once every PR in the stack is approved, the whole stack will be squash-merged to...
X Description: WarningDo not merge this PR, or any other PR in this stack, on its own. The stack exists only to make review easier. Once every PR in the stack is approved, the whole stack will be squash-merged to...
Opengraph URL: https://github.com/microsoft/durabletask-python/pull/359
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:9525566b-7e5c-525b-b759-451f60241189 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | DA82:3804E:60D53:7E7E5:6AFE2D0D |
| html-safe-nonce | 6c5bcaa31a995f5f5f5d0e576625391bc8f9fabeb6d8bc4b9699ba064fcd995f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQTgyOjM4MDRFOjYwRDUzOjdFN0U1OjZBRkUyRDBEIiwidmlzaXRvcl9pZCI6IjczMDIwMTQ0ODg4ODkxNDI1NDEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 04fc0bf339eded600a8a4e3a313a3fef3bef3d77caacb43abd5c3c66d4b27db1 |
| hovercard-subject-tag | pull_request:5265842921 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/microsoft/durabletask-python/pull/359/files |
| twitter:image | https://avatars.githubusercontent.com/u/77818326?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/77818326?s=400&v=4 |
| og:image:alt | WarningDo not merge this PR, or any other PR in this stack, on its own. The stack exists only to make review easier. Once every PR in the stack is approved, the whole stack will be squash-merged to... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | e973f9ec3625f3faad8cac5c2d11a214b7ffe45f3cc563b828459b290ecaeed3 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/microsoft/durabletask-python git https://github.com/microsoft/durabletask-python.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 627664515 |
| octolytics-dimension-repository_nwo | microsoft/durabletask-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 627664515 |
| octolytics-dimension-repository_network_root_nwo | microsoft/durabletask-python |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 1f92c367595b9190e0be293896078033886b1913 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width