Closed AKazaconoksIf closed 1 week ago
I was having the same issue. I believe that the problem is that you are awaiting for CreateTimer
, which is not an activity. It seems that, in orchestrator, we can only await for activity functions.
I believe that the problem is that you are awaiting for CreateTimer, which is not an activity. It seems that, in orchestrator, we can only await for activity functions.
This is not accurate. Calls to CreateTimer
can also be awaited - not just activity calls. You're allowed to await any call to a Task
that is returned by any of the context
methods.
@AKazaconoksIf your code looks fine. In cases like this, it's often some custom middleware that's injecting an illegal await
call into the orchestrator function's execution path. Do you have any custom middleware set up in your app?
This issue might be related.
Issue was related to the code which is executed inside ExecuteFunction as the function was timeouting before the timeout from orchestrator occurred. The only thing helped was to increase overall timeout value for all functions, which was not the solution we wanted with this custom timeout setup, so for now seems like there is no real alternative for Timeout attribute from in-process functions, unless it was created within last few months.
What version of .NET does your existing project use?
.NET 6
What version of .NET are you attempting to target?
.NET 8
Description
As Timeout attribute no longer exists in isolated functions, we found here orchestration context usage as an alternative. However time to time we are receiving error:
Exception while executing function: Functions.TimeoutOrchestrationFunction An invalid asynchronous invocation was detected. This can be caused by awaiting non-durable tasks in an orchestrator function's implementation or by middleware that invokes asynchronous code.
Our code:
Full exception:
Project configuration and dependencies
No response
Link to a repository that reproduces the issue
No response