Title: Composite tasks do not notify parent composites · Issue #266 · microsoft/durabletask-python · GitHub
Open Graph Title: Composite tasks do not notify parent composites · Issue #266 · microsoft/durabletask-python
X Title: Composite tasks do not notify parent composites · Issue #266 · microsoft/durabletask-python
Description: WhenAllTask and WhenAnyTask mark themselves complete, but do not notify their parent composite. This means the following orchestration does not resume when all activities complete: all_task = task.when_all(activity_tasks) winner = yield ...
Open Graph Description: WhenAllTask and WhenAnyTask mark themselves complete, but do not notify their parent composite. This means the following orchestration does not resume when all activities complete: all_task = task....
X Description: WhenAllTask and WhenAnyTask mark themselves complete, but do not notify their parent composite. This means the following orchestration does not resume when all activities complete: all_task = task....
Opengraph URL: https://github.com/microsoft/durabletask-python/issues/266
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Composite tasks do not notify parent composites","articleBody":"`WhenAllTask` and `WhenAnyTask` mark themselves complete, but do not notify their parent composite.\n\nThis means the following orchestration does not resume when all activities complete:\n\n```python\nall_task = task.when_all(activity_tasks)\nwinner = yield task.when_any([cancel_task, all_task])\n```\n\nA current workaround is to wait for each leaf task with repeated `when_any` calls. The workaround preserves cancellation, but Durable Task Scheduler no longer shows the standard **Fan-out** group.\n\nCould composite completion propagate to the parent in the same way that `CompletableTask.complete()` does?\n\nA regression test can compose `when_any([cancel, when_all([a, b])])`, complete `a` and `b`, and verify that the outer task completes with the inner `when_all` task.\n\r\n## Compatibility and behavior-change considerations\r\n\r\nPR #267 fixes the missing completion propagation unconditionally. The proposed\r\ndirection is to accept this intentional replay-compatibility break rather than\r\npreserve the bug, provided the affected scenarios and upgrade guidance are\r\nexplicit. This is a behavioral/replay change, not a public signature change or\r\na new abstract-method requirement for third-party subclasses.\r\n\r\n### Affected histories\r\n\r\nAn existing instance can have a history like this:\r\n\r\n1. `when_any([cancel, when_all(tasks)])` is pending.\r\n2. All activities finish, but the inner `when_all` does not notify the race.\r\n3. A later cancellation wins, and the orchestration records cancellation-branch\r\n work, for example a `cleanup` activity.\r\n4. After upgrading, replay completes the inner composite at step 2 and takes the\r\n success branch instead. If that branch schedules `finish` where history\r\n recorded `cleanup`, replay fails with `NonDeterminismError`.\r\n\r\n> [!WARNING]\r\n> A changed replay is not guaranteed to raise `NonDeterminismError`. If both\r\n> branches schedule the same activity name/ID but use different inputs or local\r\n> continuation state, the executor can accept the recorded action and continue\r\n> with the new branch. An old history using `record(\"cleanup\")` was reproduced\r\n> completing with `\"cleanup\"` on the merge base and `\"finish\"` with the fix.\r\n> Do not rely on nondeterminism errors alone to identify affected instances.\r\n\r\nThis is not a blanket break for all orchestrations. Ordinary non-nested\r\ncomposites retain their behavior. A cancellation-first history for the example\r\nabove still replays consistently. A history still blocked at the nested\r\ncomposite, with no conflicting downstream continuation, can regain progress\r\nwhen the orchestration next executes. Deploying the fix alone does not\r\nnecessarily wake an otherwise idle instance.\r\n\r\n### Provider and deployment implications\r\n\r\nBoth `durabletask.azuremanaged` and `azure-functions-durable` v2 use the core\r\nimplementation, including the Functions compatibility APIs `context.task_all()`\r\nand `context.task_any()`. Their current core constraints are open-ended:\r\n`durabletask>=1.10.1` and `durabletask[opentelemetry]>=1.10.1`, respectively.\r\nPinning only the provider therefore does not freeze this behavior; a fresh\r\ndependency resolution can pick up the correction without a provider-version\r\nchange. A core major-version bump alone would not protect those existing\r\nprovider constraints.\r\n\r\n- Pin or lock the core `durabletask` version until the transition is deliberate.\r\n- Let affected running instances finish on the previous SDK, or retain the old\r\n deployment/task hub and use a separate task hub for new instances.\r\n- Avoid mixing old and corrected workers on the same affected task hub during\r\n the transition. Stuck instances may require deliberate recovery rather than\r\n simply waiting to drain.\r\n- Keep the warnings in all three package changelogs and carry them into release\r\n notes, including upgrades from earlier Functions v2 prereleases. Coordinate\r\n package/dependency version changes in the release PR, not this fix.\r\n\r\n### PR scope and regression coverage\r\n\r\nThe latest PR already includes replay warnings in all three changelogs. The\r\nimplementation preserves result ordering, waits for all `when_all` children\r\nbefore surfacing failure, and notifies a `when_any` parent only for the first\r\nwinner. No additional public API or minimum-Python-version change is needed.\r\n\r\nThe new tests exercise task objects directly. An executor-level regression\r\nwould additionally preserve the intended scheduling/replay boundary: successful\r\nnested completion, replay of a history written by the corrected implementation,\r\nand an unchanged cancellation-first history. The legacy-history mismatch above\r\nis also useful to encode as an intentional compatibility test.\r\n\r\nThe automated review's empty-`when_all([])` concern reproduces on both the merge\r\nbase and the PR. It is a pre-existing empty-input behavior, not a regression\r\nintroduced by completion propagation. Keep any empty-input semantic change\r\nseparate rather than silently expanding this fix.\r\n","author":{"url":"https://github.com/TsuyoshiUshio","@type":"Person","name":"TsuyoshiUshio"},"datePublished":"2026-09-14T21:37:07Z","url":"https://github.com/microsoft/durabletask-python/issues/266"}
| 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 | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:2231a630-5a47-dcba-e4db-8535386db8e7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A57A:3F8062:4E492:68171:6AFE2CDD |
| html-safe-nonce | bc1c2a50b55ab64442ba7c75b2db21caa2c26627b50791b259e95d1c91bf43bf |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNTdBOjNGODA2Mjo0RTQ5Mjo2ODE3MTo2QUZFMkNERCIsInZpc2l0b3JfaWQiOiI4MTA3MjQ4NTY4Mjk0NTgzNTE4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | f0c7f52ec8e41441823c2395036fe29698b09f174f82f113a103969f5150501a |
| hovercard-subject-tag | issue:5454871776 |
| github-keyboard-shortcuts | repository,issues,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/_view_fragments/issues/show/microsoft/durabletask-python/266/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5b0da73185302c2426dcf2b4513e7250eed839633949ed7af629cc0b18fba2a3/microsoft/durabletask-python/issues/266 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5b0da73185302c2426dcf2b4513e7250eed839633949ed7af629cc0b18fba2a3/microsoft/durabletask-python/issues/266 |
| og:image:alt | WhenAllTask and WhenAnyTask mark themselves complete, but do not notify their parent composite. This means the following orchestration does not resume when all activities complete: all_task = task.... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | TsuyoshiUshio |
| hostname | github.com |
| expected-hostname | github.com |
| None | e973f9ec3625f3faad8cac5c2d11a214b7ffe45f3cc563b828459b290ecaeed3 |
| turbo-cache-control | no-preview |
| 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 |
| disable-turbo | false |
| 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 |
| react-app-name | issues |
Links:
Viewport: width=device-width