microsoft / microsoft/durabletask-java

ContinueAsNew does not support specifying a new orchestration version

Open
#276 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Needs: Triage :mag:
Dominant language
Java
Stars
29
Forks
18
Avg merge
1d 10h
Merged PRs (30d)
2

Description

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) and continueAsNew(Object input, boolean preserveUnprocessedEvents) — no version parameter
  • Java executor: CompleteOrchestrationAction.Builder never calls setNewVersion()

Proposed fix

Follow the pattern from the .NET SDK (microsoft/durabletask-dotnet#682):

  1. Add a ContinueAsNewOptions class with newInput, preserveUnprocessedEvents, and newVersion properties
  2. Add a continueAsNew(ContinueAsNewOptions options) overload to TaskOrchestrationContext
  3. In TaskOrchestrationExecutor, when newVersion is non-null, call builder.setNewVersion(StringValue.of(newVersion)) on the CompleteOrchestrationAction

Related

  • .NET SDK implementation: microsoft/durabletask-dotnet#682
  • Azure Functions extension: Azure/azure-functions-durable-extension#3404
  • Proto field: CompleteOrchestrationAction.newVersion (field 4) in orchestrator_service.proto

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating TaskOrchestrationContext and TaskOrchestrationExecutor, then inspect the existing continueAsNew overloads and CompleteOrchestrationAction construction. Use the .NET SDK issue linked in the description as a reference for the proposed options shape. Done means Java callers can provide a new version and the executor populates CompleteOrchestrationAction.newVersion while preserving current behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend-api-design, distributed-systems
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.