Azure / Azure/Azure-Functions

if add .ConfigureAwait(true) to the back of CallActivityAsync method, it was normal. But if add ‘.ConfigureAwait(false)’ to the back of ‘CallActivityAsync()' method, it will throw a exception like this:

Open
#1,520 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
PowerShell
Stars
1.1k
Forks
215
Avg merge
4h 2m
Merged PRs (30d)
1

Description

Creating the bug on behalf of the Visual Studio customer.

Bug details can be found here : https://developercommunity.visualstudio.com/content/problem/933177/configureawaitfalse.html

if add .ConfigureAwait(true) to the back of CallActivityAsync method, it was normal.
But if add ‘.ConfigureAwait(false)’ to the back of ‘CallActivityAsync()' method, it will throw a exception
like this:
[2020/2/28 0:26:00] 95ad2b6716484690979ba0a0117c9981: Function 'StorageAnalysis (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.
[2020/2/28 0:26:00] at Microsoft.Azure.WebJobs.DurableOrchestrationContext.ThrowIfInvalidAccess() in d:\a\r1\a\azure-functions-durable-extension\src\WebJobs.Extensions.DurableTask\DurableOrchestrationContext.cs:line 628
[2020/2/28 0:26:00] at Microsoft.Azure.WebJobs.DurableOrchestrationContext.CallDurableTaskFunctionAsync[TResult](String functionName, FunctionType functionType, String instanceId, RetryOptions retryOptions, Object input) in d:\a\r1\a\azure-functions-durable-extension\src\WebJobs.Extensions.DurableTask\DurableOrchestrationContext.cs:line 423
[2020/2/28 0:26:00] at AzFunc.Functions.StorageAnalysisFunction.StorageAnalysis(DurableOrchestrationContext context, ILogger log) in D:\20200227\Focus\AzFunc\Function\StorageAnalysisFunction.cs:line 91
[2020/2/28 0:26:00] at Microsoft.Azure.WebJobs.Host.Executors.VoidTaskMethodInvoker`2.InvokeAsync(TReflected instance, Object[] arguments) in C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Executors\VoidTaskMethodInvoker.cs:line 20
[2020/2/28 0:26:00] at Microsoft.Azure.WebJobs.Host.Executors.FunctionInvoker`2.InvokeAsync(Object instance, Object[] arguments)
[2020/2/28 0:26:00] at Microsoft.Azure.WebJobs.Extensions.DurableTask.TaskOrchestrationShim.InvokeFunctionAsync(RegisteredFunctionInfo orchestratorInfo) in d:\a\r1\a\azure-functions-durable-extension\src\WebJobs.Extensions.DurableTask\Listener\TaskOrchestrationShim.cs:line 149. IsReplay: False. State: Failed. HubName: DurableFunctionsHub. AppName: . SlotName: . ExtensionVersion: 1.8.5. SequenceNumber: 10.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.