Title: Preserve entity unlocks on payload failures and skip known tokens for .NET parity · Issue #307 · microsoft/durabletask-java · GitHub
Open Graph Title: Preserve entity unlocks on payload failures and skip known tokens for .NET parity · Issue #307 · microsoft/durabletask-java
X Title: Preserve entity unlocks on payload failures and skip known tokens for .NET parity · Issue #307 · microsoft/durabletask-java
Description: Java SDK for Durable Functions and the Durable Task Framework - Preserve entity unlocks on payload failures and skip known tokens for .NET parity · Issue #307 · microsoft/durabletask-java
Open Graph Description: Java SDK for Durable Functions and the Durable Task Framework - Preserve entity unlocks on payload failures and skip known tokens for .NET parity · Issue #307 · microsoft/durabletask-java
X Description: Java SDK for Durable Functions and the Durable Task Framework - Preserve entity unlocks on payload failures and skip known tokens for .NET parity · Issue #307 · microsoft/durabletask-java
Opengraph URL: https://github.com/microsoft/durabletask-java
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Preserve entity unlocks on payload failures and skip known tokens for .NET parity","articleBody":"Please bring orchestration payload-failure cleanup and known-token handling into parity with the fixes proposed in [durabletask-dotnet PR 816](https://github.com/microsoft/durabletask-dotnet/pull/816). Source inspection of current `main` (`0262c53c8f13401bfe2c25a3e058128963ad51a9`) identifies both gaps below. This is a source-backed report and a regression recipe, not a claim of a live Azure reproduction.\r\n\r\n## Findings\r\n\r\n**Entity releases are discarded by the failed-completion fallback.**\r\n\r\n- [`externalizeOrchestratorResponse`](https://github.com/microsoft/durabletask-java/blob/0262c53c8f13401bfe2c25a3e058128963ad51a9/azure-blob-payloads/src/main/java/com/microsoft/durabletask/azureblobpayloads/LargePayloadInterceptor.java#L211-L259) constructs a new response containing only `CompleteOrchestration(Failed)` when externalization throws. None of the existing actions are retained.\r\n- Those actions can include real lock releases: [`TaskOrchestrationExecutor`](https://github.com/microsoft/durabletask-java/blob/0262c53c8f13401bfe2c25a3e058128963ad51a9/client/src/main/java/com/microsoft/durabletask/TaskOrchestrationExecutor.java#L718-L762) emits either native `SendEntityMessage.EntityUnlockSent` or legacy entity-addressed `SendEvent(name=\"release\")`.\r\n- The rewrite occurs in the outbound interceptor, after the executor produced its actions. If a pending entity call or custom status fails payload externalization while the orchestration still holds locks, changing the wire response to terminal also requires generating the outstanding releases; preserving only releases already present is not sufficient.\r\n\r\n**Already-externalized values can be uploaded again.**\r\n\r\n- [`maybeExternalize`](https://github.com/microsoft/durabletask-java/blob/0262c53c8f13401bfe2c25a3e058128963ad51a9/azure-blob-payloads/src/main/java/com/microsoft/durabletask/azureblobpayloads/LargePayloadInterceptor.java#L1102-L1124) checks byte size and uploads without checking `payloadStore.isKnownPayloadToken`.\r\n- A recognized token at or above the threshold is therefore treated as ordinary data when it reaches this helper again. It can become a nested token, or fail the configured maximum-size check even though no upload is necessary.\r\n- Java protobuf requests are immutable, so this report does not assume every ordinary transport retry mutates/reuses the externalized request in the same way as .NET. The missing invariant is that externalizing an already-tokenized value must be idempotent.\r\n\r\n## Regression recipes\r\n\r\n1. Extend the existing interceptor failure test with two native unlock actions, then separately with two legacy entity releases. Force a permanent `PayloadStorageException` during custom-status or completion-result upload. The current fallback contains one Failed action; it should retain the two releases before that action and discard unrelated unpersistable work.\r\n2. Replay an orchestration that acquired two locks and is waiting on an oversized entity call. Force a permanent payload failure after replay. The failed completion must also contain releases for the still-held locks, even when no releases existed in the original response.\r\n3. Make a fake store recognize a token whose UTF-8 length exceeds the threshold. Re-externalize a response/request containing that token. The token must remain unchanged and `upload` must not be called, including when the token itself exceeds the ordinary raw-payload cap.\r\n\r\n## Acceptance Criteria\r\n\r\n- [ ] Permanent orchestration payload failures preserve native and legacy entity releases, including their destinations and critical-section/owner identity, before a single terminal Failed action.\r\n- [ ] Terminal failures introduced after orchestration execution generate any remaining acquired-lock releases before sending; they do not merely preserve releases already emitted.\r\n- [ ] Known payload tokens bypass upload and raw-payload size limits across the supported outbound payload fields.\r\n- [ ] Regression tests cover zero/partial/all previously emitted releases, terminal output and pending entity-call failures, and a second caller progressing after the releases are processed.\r\n- [ ] Transient storage failures and cancellation are not converted into permanent terminal failures, and completion retries do not duplicate releases.\r\n\r\n## Related\r\n\r\n- [.NET parity reference: PR 816](https://github.com/microsoft/durabletask-dotnet/pull/816), currently proposed rather than a released fix.\r\n- [Java PR 306](https://github.com/microsoft/durabletask-java/pull/306) addresses transient upload classification and other historical parity differences. Its inspected interceptor patch still builds a single-action response for permanent orchestration failures and does not add the known-token upload guard, so this report tracks a distinct remaining gap.\r\n","author":{"url":"https://github.com/YunchuWang","@type":"Person","name":"YunchuWang"},"datePublished":"2026-10-19T19:25:05Z","url":"https://github.com/microsoft/durabletask-java/issues/307"}
| 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/issues/:id(.:format) |
| route-controller | issues |
| route-action | show |
| fetch-nonce | v2:b49b01d2-fcae-925d-76ef-029304a82af9 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 986C:E34D0:702B8:99C39:6AFE31D2 |
| html-safe-nonce | c4d63f9c575f396dbf496149fbff7c4a4bb4d60241a94574ef56e4caa760c90c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5ODZDOkUzNEQwOjcwMkI4Ojk5QzM5OjZBRkUzMUQyIiwidmlzaXRvcl9pZCI6IjI5NTczMjE1MDg5NDAwMzQ1MTQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 557db1e60d4c8dda6332c651e7c6b939e8d108d1098f08d532580f83204e692f |
| hovercard-subject-tag | repository:452823832 |
| 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/microsoft/durabletask-java/issues/307 |
| twitter:image | https://opengraph.githubassets.com/67769f7916c8adca31cc61d7a8831c53baeda79752b258480250647c8d10f24b/microsoft/durabletask-java |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/67769f7916c8adca31cc61d7a8831c53baeda79752b258480250647c8d10f24b/microsoft/durabletask-java |
| og:image:alt | Java SDK for Durable Functions and the Durable Task Framework - Preserve entity unlocks on payload failures and skip known tokens for .NET parity · Issue #307 · microsoft/durabletask-java |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | d70e31220a67f6376c108d2416fa8e7df854c1065b1672ab7a88ab6dc3a809e2 |
| turbo-cache-control | no-cache |
| go-import | github.com/microsoft/durabletask-java git https://github.com/microsoft/durabletask-java.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 452823832 |
| octolytics-dimension-repository_nwo | microsoft/durabletask-java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 452823832 |
| octolytics-dimension-repository_network_root_nwo | microsoft/durabletask-java |
| 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 | ccb88d9c92abe69245b429398c8a57ae87070c7c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width