Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multithreaded execution was detected #2540

Open
HardikAg22 opened this issue Sep 4, 2024 · 5 comments
Open

Multithreaded execution was detected #2540

HardikAg22 opened this issue Sep 4, 2024 · 5 comments

Comments

@HardikAg22
Copy link

During our troubleshooting, we were able to see that when the durable function app was hosted on aks, then it started throwing the Multithreaded execution was detected error.

Below is the error:
4b2ff1b5-200a-5014-9174-1587041c34d0: Function 'JobMonitor (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.
at Microsoft.Azure.WebJobs.Extensions.DurableTask.DurableOrchestrationContext.ThrowIfInvalidAccess() in D:\a_work\1\s\src\WebJobs.Extensions.DurableTask\ContextImplementations\DurableOrchestrationContext.cs:line 1163
at Microsoft.Azure.WebJobs.Extensions.DurableTask.TaskOrchestrationShim.InvokeUserCodeAndHandleResults(RegisteredFunctionInfo orchestratorInfo, OrchestrationContext innerContext) in D:\a_work\1\s\src\WebJobs.Extensions.DurableTask\Listener\TaskOrchestrationShim.cs:line 150. IsReplay: False. State: Failed. HubName: TestHubName. AppName: . SlotName: . ExtensionVersion: 2.7.2. SequenceNumber: 303. TaskEventId: -1

@HardikAg22 HardikAg22 added the bug label Sep 4, 2024
@bhagyshricompany bhagyshricompany self-assigned this Sep 5, 2024
@bhagyshricompany
Copy link

Hi @HardikAg22 thanks for reporting please share all the repro steps.

@HardikAg22
Copy link
Author

Hi @bhagyshricompany
Can you share the secure link so that I can share the code.

@bhagyshricompany
Copy link

@HardikAg22
Copy link
Author

Hi @bhagyshricompany
This app is running in AKS container and not in func app. We are ok to share the portion of code in the orchestration for your reviews and recommendations.

Can you please share the mechanism to share the code.

@bhagyshricompany
Copy link

bhagyshricompany commented Sep 24, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants