microsoft / durabletask-java

Java SDK for Durable Functions and the Durable Task Framework
MIT License
13 stars 7 forks source link

Unable to suspend an orchestrator instance with functions runtime version 4.21.1.1 #147

Closed kanupriya15025 closed 12 months ago

kanupriya15025 commented 1 year ago

I am trying to suspend an orchestrator instance using HTTP APIs. My function app on azure is running function app runtime 4.21.1.1.

The suspend works well on my local which runs on version 4.21.1.20667. I see the status change to suspended. However, on my remote app deployed on Azure, I get the below error when I call the suspend API :

{"message":"Function 'EternalOrchestrator' failed with an unhandled exception.","details":"Microsoft.Azure.WebJobs.Host.FunctionInvocationException: Exception while executing function: Functions.EternalOrchestrator\n ---> System.InvalidOperationException: Exception binding parameter 'runtimeState'\n ---> System.NotSupportedException: Found unsupported history event 'ExecutionSuspended'.\n at Microsoft.Azure.WebJobs.Extensions.DurableTask.ProtobufUtils.ToHistoryEventProto(HistoryEvent e) in D:\\a\\_work\\1\\s\\src\\WebJobs.Extensions.DurableTask\\ProtobufUtils.cs:line 208\n at System.Linq.Enumerable.SelectListIterator``2.MoveNext()\n at Google.Protobuf.Collections.RepeatedField``1.AddRange(IEnumerable``1 values)\n at Google.Protobuf.Collections.RepeatedField``1.Add(IEnumerable``1 values)\n at Microsoft.Azure.WebJobs.Extensions.DurableTask.OrchestrationTriggerAttributeBindingProvider.OrchestrationTriggerBinding.BindAsync(Object value, ValueBindingContext context) in D:\\a\\_work\\1\\s\\src\\WebJobs.Extensions.DurableTask\\Bindings\\OrchestrationTriggerAttributeBindingProvider.cs:line 149\n at Microsoft.Azure.WebJobs.Host.Indexers.FunctionIndexer.TriggerWrapper.BindAsync(Object value, ValueBindingContext context) in D:\\a\\_work\\1\\s\\src\\Microsoft.Azure.WebJobs.Host\\Indexers\\FunctionIndexer.cs:line 534\n at Microsoft.Azure.WebJobs.Host.Triggers.TriggeredFunctionBinding``1.BindCoreAsync(ValueBindingContext context, Object value, IDictionary``2 parameters) in D:\\a\\_work\\1\\s\\src\\Microsoft.Azure.WebJobs.Host\\Triggers\\TriggeredFunctionBinding.cs:line 57\n --- End of inner exception stack trace ---\n at Microsoft.Azure.WebJobs.Host.Executors.DelayedException.Throw() in D:\\a\\_work\\1\\s\\src\\Microsoft.Azure.WebJobs.Host\\Executors\\DelayedException.cs:line 27\n at Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor.ParameterHelper.PrepareParametersAsync() in D:\\a\\_work\\1\\s\\src\\Microsoft.Azure.WebJobs.Host\\Executors\\FunctionExecutor.cs:line 922\n at Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor.ExecuteWithWatchersAsync(IFunctionInstanceEx instance, ParameterHelper parameterHelper, ILogger logger, CancellationTokenSource functionCancellationTokenSource) in D:\\a\\_work\\1\\s\\src\\Microsoft.Azure.WebJobs.Host\\Executors\\FunctionExecutor.cs:line 492\n at Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor.ExecuteWithLoggingAsync(IFunctionInstanceEx instance, FunctionStartedMessage message, FunctionInstanceLogEntry instanceLogEntry, ParameterHelper parameterHelper, ILogger logger, CancellationToken cancellationToken) in D:\\a\\_work\\1\\s\\src\\Microsoft.Azure.WebJobs.Host\\Executors\\FunctionExecutor.cs:line 306\n --- End of inner exception stack trace ---\n at Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor.ExecuteWithLoggingAsync(IFunctionInstanceEx instance, FunctionStartedMessage message, FunctionInstanceLogEntry instanceLogEntry, ParameterHelper parameterHelper, ILogger logger, CancellationToken cancellationToken) in D:\\a\\_work\\1\\s\\src\\Microsoft.Azure.WebJobs.Host\\Executors\\FunctionExecutor.cs:line 352\n at Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor.TryExecuteAsync(IFunctionInstance functionInstance, CancellationToken cancellationToken) in D:\\a\\_work\\1\\s\\src\\Microsoft.Azure.WebJobs.Host\\Executors\\FunctionExecutor.cs:line 108"}

Below is the API call to suspend the instance : POST https://possmartpolling-java.azurewebsites.net/runtime/webhooks/durabletask/instances/instanceId/suspend?reason={text}&code=code

kaibocai commented 1 year ago

Hi @kanupriya15025, the suspend and resume features haven't been released yet. The PR is here https://github.com/microsoft/durabletask-java/pull/146, it will be in our next release. I assume it used to work because of some miss setup on your local. Once the release is out I will let you know. Thanks.

kaibocai commented 12 months ago

@kanupriya15025, we have just released java sdk v1.2.0 which has full support for resume and suspend orchestration. Please try it out. I will close this issue. Thanks.