Title: Activity retry policies ignore failureDetails.isNonRetriable · Issue #317 · microsoft/durabletask-python · GitHub
Open Graph Title: Activity retry policies ignore failureDetails.isNonRetriable · Issue #317 · microsoft/durabletask-python
X Title: Activity retry policies ignore failureDetails.isNonRetriable · Issue #317 · microsoft/durabletask-python
Description: Summary An activity failure marked failureDetails.isNonRetriable=true is still retried when the Python orchestration uses an explicit retry policy. The retryable-task failure path calculates the next delay without checking the flag. I re...
Open Graph Description: Summary An activity failure marked failureDetails.isNonRetriable=true is still retried when the Python orchestration uses an explicit retry policy. The retryable-task failure path calculates the ne...
X Description: Summary An activity failure marked failureDetails.isNonRetriable=true is still retried when the Python orchestration uses an explicit retry policy. The retryable-task failure path calculates the ne...
Opengraph URL: https://github.com/microsoft/durabletask-python/issues/317
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Activity retry policies ignore failureDetails.isNonRetriable","articleBody":"## Summary\r\n\r\nAn activity failure marked `failureDetails.isNonRetriable=true` is still retried when the Python orchestration uses an explicit retry policy. The retryable-task failure path calculates the next delay without checking the flag.\r\n\r\nI reproduced this twice with a real Python Functions host, a DTS emulator, and Azurite. The provider correctly recorded the non-retriable failure in backend history; Python then scheduled a retry timer and another activity attempt.\r\n\r\nRelated context: [azure-functions-durable-extension#3582](https://github.com/Azure/azure-functions-durable-extension/issues/3582) and [the follow-up on #269](https://github.com/microsoft/durabletask-python/issues/269#issuecomment-6265715312). This is a separate Python retry-policy issue, not a recurrence of the shared-host payload-hydration disconnect.\r\n\r\n## Environment\r\n\r\n- Python 3.14.10 on Windows\r\n- `azure-functions==2.3.0`\r\n- `azure-functions-durable==2.0.0rc2`\r\n- `durabletask==1.12.0`\r\n- Functions Core Tools 4.16.0\r\n- Durable Functions host extension 3.15.1\r\n- AzureManaged provider with **host-side** `payloadStorageEnabled=true`, `payloadStorageThresholdBytes=131072`, and gzip enabled\r\n- Python SDK-managed payload externalization disabled\r\n\r\n## Reproduction\r\n\r\nUse an orchestration with an explicit activity retry policy and compensation handling:\r\n\r\n```python\r\n@app.orchestration_trigger(context_name=\"context\")\r\ndef orchestration(context: df.DurableOrchestrationContext):\r\n try:\r\n result = yield context.call_activity_with_retry(\r\n \"consume_payload\",\r\n df.RetryOptions(1000, 3),\r\n \"x\" * 160000,\r\n )\r\n return {\"result\": result, \"compensated\": False}\r\n except Exception:\r\n return {\"compensated\": True}\r\n\r\n\r\n@app.activity_trigger(input_name=\"payload\")\r\ndef consume_payload(payload: str):\r\n return len(payload)\r\n```\r\n\r\n1. Gate the first activity-input blob download, then delete the committed blob before allowing the download to proceed.\r\n2. Use a provider that settles this missing-input delivery with a `TaskFailed` whose `failureDetails.isNonRetriable` is `true`. Verify that flag in raw backend history. A deterministic SDK regression test can inject the same failure event directly, without blob storage.\r\n3. Let the Python orchestration process that failure.\r\n\r\n`RetryOptions` is the compatibility wrapper around `durabletask.task.RetryPolicy`; the underlying retry handling is shared.\r\n\r\n## Expected\r\n\r\nThe non-retriable failure should override the retry policy: one activity scheduling, no retry timer, and the exception should reach the orchestration's compensation handler.\r\n\r\n## Actual\r\n\r\nBoth runs recorded this sequence in raw backend history:\r\n\r\n```text\r\nTaskScheduled(consume_payload)\r\nTaskFailed(failureDetails.isNonRetriable=true)\r\nTimerCreated\r\nTimerFired\r\nTaskScheduled(consume_payload)\r\nTaskCompleted\r\nExecutionCompleted\r\n```\r\n\r\nThere were **two activity schedulings and one retry timer**, despite the non-retriable flag. In this workload, the second scheduling externalized a new, readable input blob, so the retry succeeded and the orchestration returned `compensated=false` rather than entering its exception handler.\r\n\r\nWithout an explicit retry policy, the same provider failure reached the Python exception handler as expected. Unrelated in-flight activities remained isolated and completed normally.\r\n\r\n## Source evidence\r\n\r\nIn v1.12.0, the [retryable activity failure branch](https://github.com/microsoft/durabletask-python/blob/d9cf9e214645ddca673bb6582908e50c65545102/durabletask/worker.py#L2708-L2720) calls `compute_next_delay()` and schedules a timer whenever a delay is available, without checking `event.taskFailed.failureDetails.isNonRetriable`.\r\n\r\nThe installed wheel's `worker.py` exactly matched the tagged source (Git blob `25010a17af0ed57143f399ece3176829387f08d3`). The [sub-orchestration retry branch](https://github.com/microsoft/durabletask-python/blob/d9cf9e214645ddca673bb6582908e50c65545102/durabletask/worker.py#L2820-L2831) appears to have the same omission, although I did not perform a separate live sub-orchestration retry-policy reproduction.\r\n\r\n## Suggested regression coverage\r\n\r\n- An activity `TaskFailed` with `isNonRetriable=true` fails the pending retryable task immediately, resumes the orchestrator, and creates neither a retry timer nor another activity attempt.\r\n- An otherwise identical failure with the flag unset/false retains existing retry-policy behavior.\r\n- Check the analogous sub-orchestration path.\r\n\r\nThis should honor an explicit non-retriable failure flag, not classify ordinary transient storage errors as permanent. Provider-side abandonment/redelivery for recoverable hydration failures is a different mechanism.\r\n","author":{"url":"https://github.com/andystaples","@type":"Person","name":"andystaples"},"datePublished":"2026-11-02T17:58:08Z","url":"https://github.com/microsoft/durabletask-python/issues/317"}
| 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:c7d58761-d5df-9b6f-22d6-3467b40a1af2 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A5EA:E1F78:6BF68:8DCE9:6AFE2CE3 |
| html-safe-nonce | e60afb923bda5abbead0c5d832880114edf37737b0d571d95d5f085577ce9737 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNUVBOkUxRjc4OjZCRjY4OjhEQ0U5OjZBRkUyQ0UzIiwidmlzaXRvcl9pZCI6IjEyNzY1MjI0MDkyMjkxNDAxOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 5d4e254fec713a0f1cbe655bd859a18e5c9d4db0407512252ee7dd671bb94c51 |
| hovercard-subject-tag | issue:6168053573 |
| 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/317/issue_layout |
| twitter:image | https://opengraph.githubassets.com/07e261f854ff305059f0e6d821b346d1a31491c4d0e40ffff894d1229b84c69b/microsoft/durabletask-python/issues/317 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/07e261f854ff305059f0e6d821b346d1a31491c4d0e40ffff894d1229b84c69b/microsoft/durabletask-python/issues/317 |
| og:image:alt | Summary An activity failure marked failureDetails.isNonRetriable=true is still retried when the Python orchestration uses an explicit retry policy. The retryable-task failure path calculates the ne... |
| 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