Azure / durabletask

Durable Task Framework allows users to write long running persistent workflows in C# using the async/await capabilities.
Apache License 2.0
1.47k stars 287 forks source link

Context.CreateSubOrchestration Throws Activity version not Found #1111

Closed Selekena closed 2 weeks ago

Selekena commented 3 weeks ago

I am trying to create a suborchestration with our Netherite DTFx and its throwing this exception. Questions:

  1. Are suborchestrations handled like Activites? If that's the case are they handled different to allow them to have activities of their own?
  2. How do I get this version registered? Right now we have set up the .Net app by registering all the orchestrations and their INameVersion* mappings i.e.

_ = services.AddTransient<SubscriptionLifecycleRetryingOrchestration, SubscriptionLifecycleRetryingOrchestration>(); ... services.AddSingleton<INameVersionObjectManager>(serviceProvider => new OrchestrationManager( new OrchestrationNameVersionTypeMap[] { ... new OrchestrationNameVersionTypeMap(typeof(SubscriptionLifecycleUpdateOrchestration).ToString(), "v05-01-2024"), },

later initiated like this,

result = await context.CreateSubOrchestrationInstance(nameof(SubscriptionLifecycleUpdateOrchestration), "v05-01-2024", context.OrchestrationInstance.InstanceId, input);

  1. Should I register it instead as Activity, assuming (1) is true?

TaskActivityDispatcher-14168daa1d4e4098831e7c80455f15d1-265: Unhandled exception with work item '1056': DurableTask.Core.Exceptions.TypeMissingException: TaskActivity Microsoft.Azure.EdgeProvisioning.EdgeProvisioningService.Orchestrations.SubLifecycleOrchestrations.SubscriptionLifecycleUpdateOrchestration version was not found at DurableTask.Core.TaskActivityDispatcher.<>c__DisplayClass14_1.<b_2>d.MoveNext() in //src/DurableTask.Core/TaskActivityDispatcher.cs:line 216 --- End of stack trace from previous location --- at DurableTask.Core.TaskActivityDispatcher.OnProcessWorkItemAsync(TaskActivityWorkItem workItem) in //src/DurableTask.Core/TaskActivityDispatcher.cs:line 289 at DurableTask.Core.TaskActivityDispatcher.OnProcessWorkItemAsync(TaskActivityWorkItem workItem) in //src/DurableTask.Core/TaskActivityDispatcher.cs:line 289 at DurableTask.Core.WorkItemDispatcher`1.ProcessWorkItemAsync(WorkItemDispatcherContext context, Object workItemObj) in /_/src/DurableTask.Core/WorkItemDispatcher.cs:line 459

Backing off for 10 seconds

Selekena commented 2 weeks ago

I found my issue. I had a typeof() vs nameof() confusion. Used them both on either end of a DI registration and client call.