From cb4dfea8d3de62e8cccd2aebf3557997f6f813c9 Mon Sep 17 00:00:00 2001 From: Mohamed Ali Date: Fri, 29 Dec 2023 15:37:28 +0300 Subject: [PATCH] Disable PythonEngine Shutdown to prevent deadlock --- .../HostedServices/PythonGlobalInterpreterManager.cs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/modules/Elsa.Python/HostedServices/PythonGlobalInterpreterManager.cs b/src/modules/Elsa.Python/HostedServices/PythonGlobalInterpreterManager.cs index 4b75d927f8..084d1ebe7c 100644 --- a/src/modules/Elsa.Python/HostedServices/PythonGlobalInterpreterManager.cs +++ b/src/modules/Elsa.Python/HostedServices/PythonGlobalInterpreterManager.cs @@ -44,13 +44,5 @@ public Task StartAsync(CancellationToken cancellationToken) } /// - public Task StopAsync(CancellationToken cancellationToken) - { - if(_mainThreadState != IntPtr.Zero) - { - PythonEngine.EndAllowThreads(_mainThreadState); - PythonEngine.Shutdown(); - } - return Task.CompletedTask; - } + public Task StopAsync(CancellationToken cancellationToken) => Task.CompletedTask; } \ No newline at end of file