Azure / azure-functions-durable-extension

Durable Task Framework extension for Azure Functions
MIT License
715 stars 271 forks source link

Durable entity class - AmbiguousMatchException #1696

Open joeyeng opened 3 years ago

joeyeng commented 3 years ago

Description

When I do a method overload in my Durable entity class I get a "System.Reflection.AmbiguousMatchException: Ambiguous match found" exception. In my particular case the method overload was a private method (not part of the interface). When I renamed the method the issue was fixed.

Expected behavior

Either allow method overloads or cause a compiler error.

Actual behavior

Runtime exception

Stack trace:

@bulkcalculationstate@f2b52896-d253-4871-92f0-bec867712d77: Function 'bulkcalculationstate (Entity)' failed 'AddFees' operation 08d8f9af-e35a-4eea-baed-4abbc8398ca2 after 0.9082ms with exception System.Reflection.AmbiguousMatchException: Ambiguous match found. at System.RuntimeType.GetMethodImplCommon(String name, Int32 genericParameterCount, BindingFlags bindingAttr, Binder binder, CallingConventions callConv, Type[] types, ParameterModifier[] modifiers) at System.RuntimeType.GetMethodImpl(String name, BindingFlags bindingAttr, Binder binder, CallingConventions callConv, Type[] types, ParameterModifier[] modifiers) at System.Type.GetMethod(String name, BindingFlags bindingAttr) at Microsoft.Azure.WebJobs.Extensions.DurableTask.TypedInvocationExtensions.FindMethodForContext[T](IDurableEntityContext context) in D:\a\r1\a\azure-functions-durable-extension\src\WebJobs.Extensions.DurableTask\EntityScheduler\TypedInvocationExtensions.cs:line 102 at Microsoft.Azure.WebJobs.Extensions.DurableTask.TypedInvocationExtensions.DispatchAsync[T](IDurableEntityContext context, Object[] constructorParameters) in D:\a\r1\a\azure-functions-durable-extension\src\WebJobs.Extensions.DurableTask\EntityScheduler\TypedInvocationExtensions.cs:line 37 at Microsoft.Azure.WebJobs.Host.Executors.VoidTaskMethodInvoker2.InvokeAsync(TReflected instance, Object[] arguments) in C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Executors\VoidTaskMethodInvoker.cs:line 20 at Microsoft.Azure.WebJobs.Host.Executors.FunctionInvoker2.InvokeAsync(Object instance, Object[] arguments) in C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Executors\FunctionInvoker.cs:line 52 at Microsoft.Azure.WebJobs.Extensions.DurableTask.TaskEntityShim.ProcessOperationRequestAsync(RequestMessage request) in D:\a\r1\a\azure-functions-durable-extension\src\WebJobs.Extensions.DurableTask\Listener\TaskEntityShim.cs:line 319. Input: (1060 bytes). IsReplay: False.

App Details

If deployed to Azure

We have access to a lot of telemetry that can help with investigations. Please provide as much of the following information as you can to help us investigate!

If you don't want to share your Function App or storage account name GitHub, please at least share the orchestration instance ID. Otherwise it's extremely difficult to look up information.

ConnorMcMahon commented 3 years ago

Related to #1584.

@sebastianburckhardt, I'm curious if we can make improvements to just throwing ambiguous match exception. For instance, can we identify by looking at the event sent whether to invoke the interface overload that has 0 or 1 parameters?