Title: Prevent long timers from scheduling another chunk after orchestration completion · Issue #275 · microsoft/durabletask-python · GitHub
Open Graph Title: Prevent long timers from scheduling another chunk after orchestration completion · Issue #275 · microsoft/durabletask-python
X Title: Prevent long timers from scheduling another chunk after orchestration completion · Issue #275 · microsoft/durabletask-python
Description: Bug A long timer that loses a when_any race can schedule another chunk after the orchestration has completed when its current chunk fires later in the same history batch. Confirmed on Python commit ec9af14. This corresponds to the long-t...
Open Graph Description: Bug A long timer that loses a when_any race can schedule another chunk after the orchestration has completed when its current chunk fires later in the same history batch. Confirmed on Python commit...
X Description: Bug A long timer that loses a when_any race can schedule another chunk after the orchestration has completed when its current chunk fires later in the same history batch. Confirmed on Python commit...
Opengraph URL: https://github.com/microsoft/durabletask-python/issues/275
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Prevent long timers from scheduling another chunk after orchestration completion","articleBody":"## Bug\n\nA long timer that loses a `when_any` race can schedule another chunk after the orchestration has completed when its current chunk fires later in the same history batch.\n\nConfirmed on Python commit ec9af14386ba737f3598e33867ba080f99b3d5e1. This corresponds to the long-timer portion of microsoft/durabletask-go#164, not its Go-specific forced coroutine unload/defer mechanism.\n\n## Reproduction\n\n```python\ndef orchestrator(ctx, _):\n event = ctx.wait_for_external_event(\"done\")\n timer = ctx.create_timer(timedelta(days=10))\n yield task.when_any([event, timer])\n return \"done\"\n```\n\nWith the default three-day timer chunk, replay the initial execution and timer creation. Process a new batch containing `eventRaised(\"done\", true)` followed by the first chunk's `timerFired`.\n\n**Actual:** executor emits `[completeOrchestration, createTimer]`; the new chunk is emitted after completion.\n\n**Expected:** no further long-timer chunk is scheduled after terminal completion.\n\n## Relevant code and scope\n\n`durabletask/worker.py`: `_OrchestrationExecutor.process_event`, especially the `timerFired` path and `_handle_timer_fired` result handling. Shared by core, Azure Managed, and this repository's Azure Functions provider.\n\nFix lifecycle gating precisely and preserve ordinary multi-chunk progression, cancellation, replay, retries, and legitimate pre-completion work. Add regression cases for relevant terminal states. Do not port Go coroutine-unwind machinery: Python's execution model differs.\n\nAdd applicable Unreleased changelog entries. No emulator/live-service dispatch claim is made; the invalid post-completion action output was reproduced locally.","author":{"url":"https://github.com/andystaples","@type":"Person","name":"andystaples"},"datePublished":"2026-09-29T17:41:19Z","url":"https://github.com/microsoft/durabletask-python/issues/275"}
| 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:f59cad98-1a46-81cd-a223-fff5c3a23c62 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9966:30F342:CA6FA2:11B9739:6AFE2CEF |
| html-safe-nonce | 7878673d2ee5ce5b46d31f6d1d513bbb68bbfb1ced4edc19ff26311fd118a6d1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5OTY2OjMwRjM0MjpDQTZGQTI6MTFCOTczOTo2QUZFMkNFRiIsInZpc2l0b3JfaWQiOiIzNDk0MTU4MTc3MTY1NzgyMjU1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | eff255177854247def99bfe1e5cace44f3e67042cb392f1d9dbe6a328e4f71ab |
| hovercard-subject-tag | issue:5634594683 |
| 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/275/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1d51fe439c2464147cc67e21d2b027e61fe0a5cc77a37eb4c05c968644563566/microsoft/durabletask-python/issues/275 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1d51fe439c2464147cc67e21d2b027e61fe0a5cc77a37eb4c05c968644563566/microsoft/durabletask-python/issues/275 |
| og:image:alt | Bug A long timer that loses a when_any race can schedule another chunk after the orchestration has completed when its current chunk fires later in the same history batch. Confirmed on Python commit... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | andystaples |
| 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