-
Notifications
You must be signed in to change notification settings - Fork 15
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
Changes from all commits
a1e2098
cab7522
5a804bc
132532d
f73c058
959da6a
46cc864
8b6b5af
2389289
8e5c920
7cec5d1
72c1fc8
c3c5e45
cdefa97
f17d006
4f8ac2d
7eb2567
66da59b
c6ca0e4
06b7fd7
4bfd85a
fb04187
37f27ab
ad5982e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -292,6 +292,41 @@ public abstract OrchestrationMetadata waitForInstanceCompletion( | |
| */ | ||
| public abstract String restartInstance(String instanceId, boolean restartWithNewInstanceId); | ||
|
|
||
| /** | ||
| * Rewinds a failed orchestration instance to the last known good state and replays from there. | ||
| * <p> | ||
| * This method can only be used on orchestration instances that are in a <code>Failed</code> state. | ||
| * When rewound, the orchestration instance will restart from the point of failure as if the failure | ||
| * never occurred. It rewinds the orchestration by replaying any | ||
| * Failed Activities and Failed suborchestrations that themselves have Failed Activities | ||
| * <p> | ||
| * <b>Note:</b> Rewind requires a backend that supports it. When using Azure Functions with the | ||
| * Durable Task extension, rewind is fully supported. The standalone {@code GrpcDurableTaskWorker} | ||
| * does not currently support orchestration processing for rewind. | ||
|
Comment on lines
+303
to
+305
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So, what happens if someone calls this with DTS instead of a supported backend? Is it a defined behavior that will lead to the orchestration failing? Or would it lead to a non-deterministic state/stuck orchestration? If it fails the orchestration, I'm fine just having a note here. If it will lead to stuck orchestrations, I wonder if we can find a way to reject/fail it in the worker?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So all backends support rewind (including DTS). This is only an issue if someone is trying to use the Hence this part of the method comment: The standalone {@code GrpcDurableTaskWorker} does not currently support orchestration processing for rewind.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It fails with the following error: I was seeing this error in the CI tests when I added durabletask rewind tests which is how I found out that it wasn't supported. Here's a test run where this was happening: https://github.com/microsoft/durabletask-java/actions/runs/21721638553/job/62652715658
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As long as it's consistent, I'm OK with the note. The main thing I wanted to avoid was someone accidentally rewinding a valid, in-progress orchestration on an unsupported backend and having it get in a weird stuck state. If that's not the case, I'm good with this :) |
||
| * | ||
| * @param instanceId the ID of the orchestration instance to rewind | ||
| */ | ||
| public void rewindInstance(String instanceId) { | ||
| this.rewindInstance(instanceId, null); | ||
| } | ||
|
|
||
| /** | ||
| * Rewinds a failed orchestration instance to the last known good state and replays from there. | ||
| * <p> | ||
| * This method can only be used on orchestration instances that are in a <code>Failed</code> state. | ||
| * When rewound, the orchestration instance will restart from the point of failure as if the failure | ||
| * never occurred. It rewinds the orchestration by replaying any | ||
| * Failed Activities and Failed suborchestrations that themselves have Failed Activities | ||
| * <p> | ||
| * <b>Note:</b> Rewind requires a backend that supports it. When using Azure Functions with the | ||
| * Durable Task extension, rewind is fully supported. The standalone {@code GrpcDurableTaskWorker} | ||
| * does not currently support orchestration processing for rewind. | ||
| * | ||
| * @param instanceId the ID of the orchestration instance to rewind | ||
bachuv marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| * @param reason the reason for rewinding the orchestration instance | ||
| */ | ||
| public abstract void rewindInstance(String instanceId, @Nullable String reason); | ||
|
|
||
| /** | ||
| * Suspends a running orchestration instance. | ||
| * @param instanceId the ID of the orchestration instance to suspend | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.