microsoft / microsoft/durabletask-java
ContinueAsNew does not support specifying a new orchestration version
還沒有人認領這個 Issue。
- 主要語言
- Java
- 星號
- 29
- 分支
- 18
- 平均合併
- 1 天 10 小時
- 30 天內合併 PR
- 2
描述
Summary
The continueAsNew() API does not expose a way to specify a new orchestration version for the restarted instance. The underlying protobuf field (CompleteOrchestrationAction.newVersion, field 4) has existed since the initial proto commit, but the Java SDK never populates it.
Problem
TaskOrchestrationContext.continueAsNew() only accepts (Object input, boolean preserveUnprocessedEvents). There is no parameter to pass a new version. In TaskOrchestrationExecutor, when building the CompleteOrchestrationAction, setNewVersion() is never called — the field is always left empty.
This prevents version migration scenarios for long-running/eternal orchestrations (e.g., monitoring loops that need to evolve their logic over time via continueAsNew with a new version).
What exists today
- Proto layer:
CompleteOrchestrationAction.newVersion(field 4) is defined and supported by all backends (DurableTask.Core since 2014, DTS/Beskar, gRPC sidecar) - Java API:
continueAsNew(Object input)andcontinueAsNew(Object input, boolean preserveUnprocessedEvents)— no version parameter - Java executor:
CompleteOrchestrationAction.Buildernever callssetNewVersion()
Proposed fix
Follow the pattern from the .NET SDK (microsoft/durabletask-dotnet#682):
- Add a
ContinueAsNewOptionsclass withnewInput,preserveUnprocessedEvents, andnewVersionproperties - Add a
continueAsNew(ContinueAsNewOptions options)overload toTaskOrchestrationContext - In
TaskOrchestrationExecutor, whennewVersionis non-null, callbuilder.setNewVersion(StringValue.of(newVersion))on theCompleteOrchestrationAction
Related
- .NET SDK implementation: microsoft/durabletask-dotnet#682
- Azure Functions extension: Azure/azure-functions-durable-extension#3404
- Proto field:
CompleteOrchestrationAction.newVersion(field 4) inorchestrator_service.proto
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
先定位 TaskOrchestrationContext 和 TaskOrchestrationExecutor,接著檢查現有的 continueAsNew 多載以及 CompleteOrchestrationAction 的建構。使用描述中連結的 .NET SDK issue 作為所提議 options 形狀的參考。當 Java 呼叫端可以提供新版本,且 executor 在保留目前行為的同時填入 CompleteOrchestrationAction.newVersion 時,即表示完成。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- java
- 領域
- backend-api-design, distributed-systems
- Issue 類型
- 功能
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 活躍度
- 冷清
- 描述清晰度
- 描述清楚
- 新手友好度
- 68/100