-
Notifications
You must be signed in to change notification settings - Fork 16
Adding rewind client API #253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request adds support for the rewind functionality in the Java SDK for Durable Task Framework. Rewind allows failed orchestrations to be replayed from their last known good state, which is useful for recovering from transient failures.
Changes:
- Added
rewindInstanceAPI methods toDurableTaskClientandDurableTaskGrpcClientfor rewinding failed orchestrations - Added
rewindPostUrifield toHttpManagementPayloadto support HTTP-based rewind operations in Azure Functions - Updated protobuf definitions with
ExecutionRewoundEventand related changes to support the rewind feature
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| client/src/main/java/com/microsoft/durabletask/DurableTaskClient.java | Adds public API methods for rewinding orchestration instances with optional reason parameter |
| client/src/main/java/com/microsoft/durabletask/DurableTaskGrpcClient.java | Implements rewindInstance by building and sending RewindInstanceRequest via gRPC |
| azurefunctions/src/main/java/com/microsoft/durabletask/azurefunctions/HttpManagementPayload.java | Adds rewindPostUri field with reason parameter placeholder for HTTP-based rewind operations |
| samples/src/main/java/io/durabletask/samples/RewindPattern.java | Demonstrates rewind functionality with sample code that fails once then succeeds after rewind |
| endtoendtests/src/test/java/com/functions/EndToEndTests.java | Adds end-to-end test for rewind functionality and improves test configuration with @BeforeAll setup |
| endtoendtests/src/main/java/com/functions/RewindTest.java | Implements Azure Functions-based test orchestration that demonstrates the rewind feature |
| internal/durabletask-protobuf/protos/orchestrator_service.proto | Adds ExecutionRewoundEvent and extends multiple messages with new fields for rewind support |
| internal/durabletask-protobuf/PROTO_SOURCE_COMMIT_HASH | Updates to reflect the new protobuf source version |
| CHANGELOG.md | Documents the new rewind client API feature |
| .github/workflows/build-validation.yml | Increases emulator initialization wait time and adds logging for better CI reliability |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| } | ||
|
|
||
| @Override | ||
| public void rewindInstance(String instanceId, @Nullable String reason) { |
Copilot
AI
Jan 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing null check for instanceId parameter. Similar methods in this class like terminate() at line 249 use Helpers.throwIfArgumentNull(instanceId, "instanceId") to validate the parameter. This validation should be added for consistency and to provide a clear error message when null is passed.
| public void rewindInstance(String instanceId, @Nullable String reason) { | |
| public void rewindInstance(String instanceId, @Nullable String reason) { | |
| Helpers.throwIfArgumentNull(instanceId, "instanceId"); |
|
|
||
| message OrchestrationTraceContext { | ||
| google.protobuf.StringValue spanID = 1; | ||
| google.protobuf.Timestamp spanStartTime = 2; |
Copilot
AI
Jan 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing whitespace detected at the end of line 338. Please remove the extra spaces after the semicolon to maintain consistent formatting.
| google.protobuf.Timestamp spanStartTime = 2; | |
| google.protobuf.Timestamp spanStartTime = 2; |
| rpc QueryInstances(QueryInstancesRequest) returns (QueryInstancesResponse); | ||
|
|
||
| rpc ListInstanceIds(ListInstanceIdsRequest) returns (ListInstanceIdsResponse); | ||
|
|
Copilot
AI
Jan 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing whitespace detected at the end of line 776. Please remove the extra spaces to maintain consistent formatting.
| RestAssured.baseURI = "http://localhost"; | ||
| // Use port 8080 for Docker, 7071 for local func start | ||
| String port = System.getenv("FUNCTIONS_PORT"); | ||
| RestAssured.port = port != null ? Integer.parseInt(port) : 8080; |
Copilot
AI
Jan 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Potential uncaught 'java.lang.NumberFormatException'.
| RestAssured.port = port != null ? Integer.parseInt(port) : 8080; | |
| int resolvedPort = 8080; | |
| if (port != null && !port.isEmpty()) { | |
| try { | |
| resolvedPort = Integer.parseInt(port); | |
| } catch (NumberFormatException e) { | |
| System.err.println("Invalid FUNCTIONS_PORT value '" + port + "'. Falling back to default port " + resolvedPort + "."); | |
| } | |
| } | |
| RestAssured.port = resolvedPort; |
Adding the rewind API for the Java SDK.
rewindPostUritoHttpManagementPayloadrewindInstanceAPI inDurableTaskClientPull request checklist
CHANGELOG.md