From aa75a5cc22d8e3f5eff2302f17b1ac5b095fbba8 Mon Sep 17 00:00:00 2001 From: Aishwarya Bhandari Date: Thu, 18 Jan 2024 09:35:52 -0800 Subject: [PATCH 1/2] changes --- .../DurableTaskExtension.cs | 3 -- .../OutOfProcMiddleware.cs | 29 +++++++++++++++++++ 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/src/WebJobs.Extensions.DurableTask/DurableTaskExtension.cs b/src/WebJobs.Extensions.DurableTask/DurableTaskExtension.cs index 3ae312bef..31ec75c42 100644 --- a/src/WebJobs.Extensions.DurableTask/DurableTaskExtension.cs +++ b/src/WebJobs.Extensions.DurableTask/DurableTaskExtension.cs @@ -456,14 +456,11 @@ void IExtensionConfigProvider.Initialize(ExtensionConfigContext context) "For more information on extension bundles, see https://docs.microsoft.com/azure/azure-functions/functions-bindings-register#extension-bundles."); #endif } - else - { // This is the older middleware implementation that is currently in use for in-process .NET // and the older out-of-proc languages, like Node.js, Python, and PowerShell. this.taskHubWorker.AddActivityDispatcherMiddleware(this.ActivityMiddleware); this.taskHubWorker.AddOrchestrationDispatcherMiddleware(this.EntityMiddleware); this.taskHubWorker.AddOrchestrationDispatcherMiddleware(this.OrchestrationMiddleware); - } // The RPC server needs to be started sometime before any functions can be triggered // and this is the latest point in the pipeline available to us. diff --git a/src/WebJobs.Extensions.DurableTask/OutOfProcMiddleware.cs b/src/WebJobs.Extensions.DurableTask/OutOfProcMiddleware.cs index cf45c2521..56669a615 100644 --- a/src/WebJobs.Extensions.DurableTask/OutOfProcMiddleware.cs +++ b/src/WebJobs.Extensions.DurableTask/OutOfProcMiddleware.cs @@ -269,6 +269,35 @@ public async Task CallEntityAsync(DispatchMiddlewareContext dispatchContext, Fun FunctionName functionName = new FunctionName(entityId.EntityName); RegisteredFunctionInfo functionInfo = this.extension.GetEntityInfo(functionName); + if (entityId.EntityName?.StartsWith("openai::", StringComparison.OrdinalIgnoreCase) ?? false) + { + try + { + await next(); + } + catch (Exception hostRuntimeException) + { + try + { + await next(); + } + catch (Exception hostRuntimeException2) + { + try + { + await next(); + } + catch (Exception hostRuntimeException3) + { + var lol = hostRuntimeException3; + } + + } + } + + return; + } + void SetErrorResult(FailureDetails failureDetails) { // Returns a result with no operation results and no state change, From a62a6719d25ebd2c110ec575cd6fe8a92fc436e3 Mon Sep 17 00:00:00 2001 From: Aishwarya Bhandari Date: Thu, 18 Jan 2024 09:41:42 -0800 Subject: [PATCH 2/2] changes --- .../OutOfProcMiddleware.cs | 25 +------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/src/WebJobs.Extensions.DurableTask/OutOfProcMiddleware.cs b/src/WebJobs.Extensions.DurableTask/OutOfProcMiddleware.cs index 56669a615..b10cb1cda 100644 --- a/src/WebJobs.Extensions.DurableTask/OutOfProcMiddleware.cs +++ b/src/WebJobs.Extensions.DurableTask/OutOfProcMiddleware.cs @@ -271,30 +271,7 @@ public async Task CallEntityAsync(DispatchMiddlewareContext dispatchContext, Fun if (entityId.EntityName?.StartsWith("openai::", StringComparison.OrdinalIgnoreCase) ?? false) { - try - { - await next(); - } - catch (Exception hostRuntimeException) - { - try - { - await next(); - } - catch (Exception hostRuntimeException2) - { - try - { - await next(); - } - catch (Exception hostRuntimeException3) - { - var lol = hostRuntimeException3; - } - - } - } - + await next(); return; }