在Azure持久函数中设置MaxOrchestrationActions [英] Setting MaxOrchestrationActions in an Azure Durable Function

查看:66
本文介绍了在Azure持久函数中设置MaxOrchestrationActions的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在使用一个持久的Orchestrator函数,该函数需要对Activity函数进行数百万次调用.100,000次调用后,我们看到以下异常:

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:

已达到最大编排操作100,000.这值可以在host.json文件中配置为MaxOrchestrationActions.

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.

此处为host.json模式,未指定.

我为 Azure功能持久扩展的开发部门负责人a>并通过源代码进行跟踪.看来可以将此 设置为DurableTaskOptions.MaxOrchestrationActions,但必须在将其传递到DurableOrchestrationContext类之前对其进行设置.

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.

我们猜测host.json中的属性可能是

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

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

但是没有运气.

有人对如何设置MaxOrchestrationActions有指导吗?

Does anyone have guidance on how to set MaxOrchestrationActions?

更新我的问题是我正在使用旧版本的Microsoft.Azure.WebJobs.Extensions.DurableTask框架.当我更新到2.1.1后,它可以按预期工作.

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.

我已经向Microsoft Doc团队报告了maxOrchestrationActions的文档不足,他们正在对文档进行更新.

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

推荐答案

您是对的,默认值为100k,应该可以使用host.json进行更改.

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
      }
   }
}

更多信息:

https://docs.microsoft.com/zh-cn/dotnet/api/microsoft.azure.webjobs.extensions.durabletask.durabletaskoptions?view=azure-dotnet

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

这篇关于在Azure持久函数中设置MaxOrchestrationActions的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆