Skip to content

Conversation

@sophiatev
Copy link
Collaborator

@sophiatev sophiatev commented Oct 15, 2025

This PR introduces the rewind API for .NET isolated apps. It also adds logic to correctly handle the new ExecutionRewoundEvent in the protos.

Note: I plan to add E2E tests for this once a new version of the DTS emulator is released with the backend implementation for rewind. In the meantime I have added thorough integration tests to the DTS repo. The only functionality not tested is if the API correctly handles trying to rewind un-failed or non-existent orchestrations, which I have tested manually and this works as expected.

Pull request checklist

  • My changes do not require documentation changes
    • Otherwise: Documentation PR is ready to merge and referenced in pending_docs.md
  • My changes should not be added to the release notes for the next release
    • Otherwise: I've added my notes to release_notes.md
  • My changes do not need to be backported to a previous version
    • Otherwise: Backport tracked by issue/PR #issue_or_pr
  • I have added all required tests (Unit tests, E2E tests)
  • My changes do not require any extra work to be leveraged by OutOfProc SDKs
    • Otherwise: That work is being tracked here: #issue_or_pr_in_each_sdk
  • My changes do not change the version of the WebJobs.Extensions.DurableTask package
    • Otherwise: major or minor version updates are reflected in /src/Worker.Extensions.DurableTask/AssemblyInfo.cs
  • My changes do not add EventIds to our EventSource logs
    • Otherwise: Ensure the EventIds are within the supported range in our existing Windows infrastructure. You may validate this with a deployed app's telemetry. You may also extend the range by completing a PR such as this one.
  • My changes should be added to v2.x branch.
    • Otherwise: This change applies exclusively to WebJobs.Extensions.DurableTask v3.x. It will be retained only in the dev and main branches and will not be merged into the v2.x branch.

Comment on lines +110 to +117
if (this.fixture.functionLanguageLocalizer.GetLanguageType() == LanguageType.DotnetIsolated)
{
Assert.Equal(HttpStatusCode.PreconditionFailed, rewindResponse.StatusCode);
}
else
{
Assert.Equal(HttpStatusCode.BadRequest, rewindResponse.StatusCode);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why different response values depending on the language? Should we add comments explaining this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to explain this in the comment for the first instance of where this happens (maybe the placement of the comment is not great)

// For all of the following tests, since Node throws a generic error in the case of a failure to rewind there is no great way 
// to return specific status codes, whereas .NET isolated returns specific error types which can be used to return specific status codes.
// So, in the Node case, we simply check for the BadRequest status code.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is generally true for gRPC vs HTTP worker SDKs, and is also true for APIs like suspend/resume/terminate, where we have similar logic in the E2E tests.

Comment on lines +110 to +117
if (this.fixture.functionLanguageLocalizer.GetLanguageType() == LanguageType.DotnetIsolated)
{
Assert.Equal(HttpStatusCode.PreconditionFailed, rewindResponse.StatusCode);
}
else
{
Assert.Equal(HttpStatusCode.BadRequest, rewindResponse.StatusCode);
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is generally true for gRPC vs HTTP worker SDKs, and is also true for APIs like suspend/resume/terminate, where we have similar logic in the E2E tests.

@sophiatev sophiatev merged commit 3c80b34 into dev Nov 7, 2025
19 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants