Skip to content
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

Override new "base" Terminate API #2829

Merged
merged 7 commits into from
May 28, 2024
Merged

Override new "base" Terminate API #2829

merged 7 commits into from
May 28, 2024

Conversation

davidmrdavid
Copy link
Contributor

@davidmrdavid davidmrdavid commented May 23, 2024

Follow up to: #2802

The PR above made the FunctionsDurableTaskClient override new overloads from DurableTaskClient which were causing issues as reported here: microsoft/durabletask-dotnet#282 (comment)

Seems we missed the TerminateInstanceAsync API in the PR above, so this PR adds it.

This PR also adds what appears to be the first set of unit tests for the .NET isolated worker extension. In it, we're testing against this particular exception: that the TerminateInstanceAsync API can be invoked without triggering exceptions. I tested with and without the code change and confirmed that the test is fails without the change, and passes with it.

Note: the new test project I added won't run as part of the CI automatically. I think to do that, I need to create a new ADO pipeline. Given that we're migrating our CI to a different ADO organization, now may not be the right time to add it either, so I'd like to do that in a different PR.

Issue describing the changes in this PR

resolves microsoft/durabletask-dotnet#282 (comment)

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 v3.x branch.
    • Otherwise: This change only applies to Durable Functions v2.x and will not be merged to branch v3.x.

using Microsoft.Azure.Functions.Worker.Extensions.Abstractions;

// TODO: Find a way to generate this dynamically at build-time
[assembly: ExtensionInformation("Microsoft.Azure.WebJobs.Extensions.DurableTask", "2.13.3")]
[assembly: InternalsVisibleTo("Worker.Extensions.DurableTask.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100cd1dabd5a893b40e75dc901fe7293db4a3caf9cd4d3e3ed6178d49cd476969abe74a9e0b7f4a0bb15edca48758155d35a4f05e6e852fff1b319d103b39ba04acbadd278c2753627c95e1f6f6582425374b92f51cca3deb0d2aab9de3ecda7753900a31f70a236f163006beefffe282888f85e3c76d1205ec7dfef7fa472a17b1")]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

So that internal classes can be tested in the tests project. This is a standard pattern, and we use it for the DF WebJobs Extension tests afaik.

Comment on lines +23 to +24
string readerString = reader.GetString() ?? string.Empty;
return new HttpMethod(readerString);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There was a small warning that reader.GetString() might return null. So I added this to make sure the method was well typed.

@davidmrdavid davidmrdavid merged commit 9583bb0 into dev May 28, 2024
20 checks passed
@davidmrdavid davidmrdavid deleted the dajusto/terminate-fix branch May 28, 2024 17:20
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.

DurableTaskClient.PurgeAllInstancesAsync: NotSupportedException and RpcException for .net 8 isolated
2 participants