azure-durable-functions - Orchestrator 函数代码等待不是由 DurableOrchestrationContext 方法创建的任务
问题描述
我在 Orchestrator 函数中有以下代码:
var sourceGroups = await context.CallActivityAsync<AzureADGroup[]>(nameof(SourceGroupsReaderFunction), new SourceGroupsReaderRequest { SyncJob = syncJob, RunId = runId });
if (sourceGroups.Length == 0)
{
await _log.LogMessageAsync(new LogMessage
{
RunId = runId,
Message =
$"None of the source groups in {syncJob.Query} were valid guids. Marking job as errored."
});
await _calculator.SendEmailAsync(syncJob, runId, SyncDisabledNoValidGroupIds, new[] { syncJob.Query });
}
在运行它时,我看到以下错误:
Function 'OrchestratorFunction (Orchestrator)' failed with an error. Reason: System.InvalidOperationException: Multithreaded execution was detected. This can happen if the orchestrator function code awaits on a task that was not created by a DurableOrchestrationContext method. More details can be found in this article https://docs.microsoft.com/en-us/azure/azure-functions/durable-functions-checkpointing-and-replay#orchestrator-code-constraints.
我错过了什么?
解决方案
推荐阅读
- ios - 如何使用数组创建 NSPredicate 包含元素
- python - 如何在python中重复石头、纸、剪刀的游戏
- r - 在函数中的 pull() 之后控制数据帧中的 diff() 或 tibble
- html - 当我从内联块 div 中删除 textContent 时,为什么会出现间隙?
- windows - 如何搜索目录,然后将目录更改为该目录
- python - Python:如何将嵌套字典(字典列表中的字典)写入 excel xlsx 文件
- symfony4 - 用户更改选项时如何显示/隐藏
- c - 没有 /dev/console 的 RTEMS
- c++ - OpenCV图像转换问题(BayerGB8转RGB)
- microsoft-graph-api - OneNote 现在需要 Notes.ReadWrite.All,Notes.Read.All 权限