0

We're using a Durable Orchestrator Function that needs to make several million calls to Activity functions. We're seeing the following exception after 100,000 invocations:

Maximum amount of orchestration actions 100,000 has been reached. This value can be configured in host.json file as MaxOrchestrationActions.

However, I cannot find HOW to set this value.

In the host.json schema here, it's not specified.

I've pulled the head of the dev branch for Azure Function Durable Extension and traced through the source code. It appears that this can be set as DurableTaskOptions.MaxOrchestrationActions, but it must be set before it's passed into the DurableOrchestrationContext class.

We've taken a guess that the property in host.json might be

{
   "extensions": {
      ... other settings omitted for brevity ...
      "durableTask": {
         "MaxOrchestrationActions": xxxx
      }
   }
}

But had no luck.

Does anyone have guidance on how to set MaxOrchestrationActions?

Update My problem was that I was using an older version of the Microsoft.Azure.WebJobs.Extensions.DurableTask framework. Once I updated to 2.1.1, it worked as expected.

I have reported the lack of documentation of maxOrchestrationActions to the Microsoft Doc team, and they're making an update to the documentation.

Rob Reagan
  • 7,313
  • 3
  • 20
  • 49

2 Answers2

1

You're right, the default value is 100k and you should be able to change using host.json.

Two things that I've noticed: you're not providing version number and you're not using camel case:

{
   "version": "2.0",
   "extensions": {
      "durableTask": {
         "maxOrchestrationActions": xxxx
      }
   }
}

More Info:

https://learn.microsoft.com/en-us/dotnet/api/microsoft.azure.webjobs.extensions.durabletask.durabletaskoptions?view=azure-dotnet

https://github.com/Azure/azure-functions-durable-extension/pull/982/commits/fd63d9436ef7fe4748c3a6aff95f9ac8596ab587

Thiago Custodio
  • 17,332
  • 6
  • 45
  • 90
  • Thanks for the response. I omitted all other host.json properties for the sake of brevity, but have now notated that in my question. I have also tried both MaxOrchestrationActions (as stated in the error message) and maxOrchestrationActions, but with no luck in either case. The link to the DurableTaskOptions class does show the property we want to change, but setting it after the DurableOrchestrationContext is initialized does no good. In the DurableOrchestrationContext constructor, that property is copied into a private readonly int. – Rob Reagan Jul 07 '20 at 15:08
  • this link https://learn.microsoft.com/en-us/dotnet/api/microsoft.azure.webjobs.extensions.durabletask.durabletaskoptions.maxorchestrationactions?view=azure-dotnet#Microsoft_Azure_WebJobs_Extensions_DurableTask_DurableTaskOptions_MaxOrchestrationActions ? – Thiago Custodio Jul 07 '20 at 15:14
  • Your code snippet is correct. My problem was that I was not using the latest version of the Microsoft.Azure.WebJobs.Extensions.DurableTask framework. – Rob Reagan Jul 08 '20 at 11:10
0

For me, the recommended answer didn't work. This could be because I have dependency injection. So I manage to achieve this by injecting DurableTaskOptions like this:

.AddSingleton<IOptions<DurableTaskOptions>>(new OptionsWrapper<DurableTaskOptions>(
                    new DurableTaskOptions
                        {MaxOrchestrationActions = 1500000}))
Umang
  • 815
  • 5
  • 17