From fa46b9e0c91d2236c16a3687a161accd0c753a4a Mon Sep 17 00:00:00 2001 From: Matous Kozak Date: Thu, 11 Jul 2024 09:06:07 +0200 Subject: [PATCH] Revert "[browser][MT] troubleshooting deadlocks 2 (#104615)" This reverts commit ed9642ecd927791665e39f709aa036d200df6e8b. --- .../InteropServices/JavaScript/Interop/JavaScriptExports.cs | 2 +- .../InteropServices/JavaScript/JSSynchronizationContext.cs | 4 ++-- .../Runtime/InteropServices/JavaScript/WebWorkerTest.cs | 2 -- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/libraries/System.Runtime.InteropServices.JavaScript/src/System/Runtime/InteropServices/JavaScript/Interop/JavaScriptExports.cs b/src/libraries/System.Runtime.InteropServices.JavaScript/src/System/Runtime/InteropServices/JavaScript/Interop/JavaScriptExports.cs index e2ee42ffec2f6..6bb74c0f42fe8 100644 --- a/src/libraries/System.Runtime.InteropServices.JavaScript/src/System/Runtime/InteropServices/JavaScript/Interop/JavaScriptExports.cs +++ b/src/libraries/System.Runtime.InteropServices.JavaScript/src/System/Runtime/InteropServices/JavaScript/Interop/JavaScriptExports.cs @@ -277,7 +277,7 @@ public static void InstallMainSynchronizationContext(JSMarshalerArgument* argume } catch (Exception ex) { - Environment.FailFast($"InstallMainSynchronizationContext: Unexpected failure (ManagedThreadId {Environment.CurrentManagedThreadId}): " + ex); + arg_exc.ToJS(ex); } } diff --git a/src/libraries/System.Runtime.InteropServices.JavaScript/src/System/Runtime/InteropServices/JavaScript/JSSynchronizationContext.cs b/src/libraries/System.Runtime.InteropServices.JavaScript/src/System/Runtime/InteropServices/JavaScript/JSSynchronizationContext.cs index 2a2f134e9e9e0..e93b1774d6871 100644 --- a/src/libraries/System.Runtime.InteropServices.JavaScript/src/System/Runtime/InteropServices/JavaScript/JSSynchronizationContext.cs +++ b/src/libraries/System.Runtime.InteropServices.JavaScript/src/System/Runtime/InteropServices/JavaScript/JSSynchronizationContext.cs @@ -294,9 +294,9 @@ private void Pump() // otherwise, we could schedule another round AwaitNewData(); } - catch (Exception ex) + catch (Exception e) { - Environment.FailFast($"JSSynchronizationContext.Pump: Unexpected failure (ManagedThreadId {Environment.CurrentManagedThreadId}): " + ex); + Environment.FailFast($"JSSynchronizationContext.Pump failed, ManagedThreadId: {Environment.CurrentManagedThreadId}. {Environment.NewLine} {e.StackTrace}"); } } diff --git a/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System/Runtime/InteropServices/JavaScript/WebWorkerTest.cs b/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System/Runtime/InteropServices/JavaScript/WebWorkerTest.cs index c247ef332921f..24ff04897c2a8 100644 --- a/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System/Runtime/InteropServices/JavaScript/WebWorkerTest.cs +++ b/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System/Runtime/InteropServices/JavaScript/WebWorkerTest.cs @@ -520,7 +520,6 @@ await executor.Execute(async () => } [Theory, MemberData(nameof(GetTargetThreadsAndBlockingCalls))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/99951")] public async Task WaitAssertsOnSyncCallback(Executor executor, NamedCall method) { using var cts = CreateTestCaseTimeoutSource(); @@ -556,7 +555,6 @@ await WebWorkerTestHelper.CallMeBackSync(() => } [Theory, MemberData(nameof(GetTargetThreadsAndBlockingCalls))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/99951")] public async Task WaitAssertsOnSyncJSExport(Executor executor, NamedCall method) { using var cts = CreateTestCaseTimeoutSource();