Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[browser][MT] PlatformNotSupportedException Blocking wait is not supported on the JS interop threads #98804

Closed
pavelsavara opened this issue Feb 22, 2024 · 5 comments · Fixed by #99833
Assignees
Labels
arch-wasm WebAssembly architecture area-VM-threading-mono blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' Known Build Error Use this to report build issues in the .NET Helix tab os-browser Browser variant of arch-wasm
Milestone

Comments

@pavelsavara
Copy link
Member

pavelsavara commented Feb 22, 2024

Error Blob

{
  "ErrorMessage": "",
  "BuildRetry": false,
  "ErrorPattern": "System\.PlatformNotSupportedException ?: Blocking wait is not supported on the JS interop threads",
  "ExcludeConsoleLog": false
}

Reproduction Steps

Log
Build: https://dev.azure.com/dnceng-public/public/_build/results?buildId=574940

[22:24:46] info: [FAIL] System.Net.Http.Functional.Tests.SocketsHttpHandler_HttpClientHandlerTest.ReadAsStreamAsync_EmptyResponseBody_HandlerProducesWellBehavedResponseStream
[22:24:46] info: System.PlatformNotSupportedException : Blocking wait is not supported on the JS interop threads.
[22:24:46] info:    at System.Threading.Thread.AssureBlockingPossible()
[22:24:46] info:    at System.Threading.SemaphoreSlim.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
[22:24:46] info:    at System.Threading.SemaphoreSlim.Wait()
[22:24:46] info:    at System.IO.Stream.BeginReadInternal(Byte[] buffer, Int32 offset, Int32 count, AsyncCallback callback, Object state, Boolean serializeAsynchronously, Boolean apm)
[22:24:46] info:    at System.IO.Stream.BeginRead(Byte[] buffer, Int32 offset, Int32 count, AsyncCallback callback, Object state)
[22:24:46] info:    at System.Threading.Tasks.TaskFactory`1[[System.Int32, System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].FromAsyncImpl[Byte[],Int32,Int32](Func`6 beginMethod, Func`2 endFunction, Action`1 endAction, Byte[] arg1, Int32 arg2, Int32 arg3, Object state, TaskCreationOptions creationOptions)
[22:24:46] info:    at System.Threading.Tasks.TaskFactory.FromAsync[Byte[],Int32,Int32,Int32](Func`6 beginMethod, Func`2 endMethod, Byte[] arg1, Int32 arg2, Int32 arg3, Object state)
[22:24:46] info:    at System.Net.Http.Functional.Tests.HttpClientHandlerTest.<ReadAsStreamAsync_EmptyResponseBody_HandlerProducesWellBehavedResponseStream>b__29_0(Uri uri)
[22:24:46] info:    at System.Threading.Tasks.TaskTimeoutExtensions.GetRealException(Task task)
[22:24:46] info: --- End of stack trace from previous location ---
[22:24:46] info:    at System.Threading.Tasks.TaskTimeoutExtensions.WhenAllOrAnyFailed(Task[] tasks)
[22:24:46] info:    at System.Net.Test.Common.LoopbackServerFactory.<>c__DisplayClass6_0.<<CreateClientAndServerAsync>b__0>d.MoveNext()
[22:24:46] info: --- End of stack trace from previous location ---
[22:24:46] info:    at System.Net.Test.Common.LoopbackServer.CreateServerAsync(Func`2 funcAsync, Options options)
[22:24:46] info:    at System.Net.Http.Functional.Tests.HttpClientHandlerTest.ReadAsStreamAsync_EmptyResponseBody_HandlerProducesWellBehavedResponseStream()
[22:24:46] info: --- End of stack trace from previous location ---

Known issue validation

Build: 🔎
Result validation: ⚠️ Provided build not found. Provide a valid build in the "Build: 🔎" line.
Validation performed at: 4/15/2024 7:27:53 PM UTC

Report

Build Definition Test Pull Request
643881 dotnet/runtime WasmTestOnBrowser-System.Runtime.InteropServices.JavaScript.Tests.WorkItemExecution #101056
644056 dotnet/runtime WasmTestOnBrowser-System.Runtime.InteropServices.JavaScript.Tests.WorkItemExecution #101038
643951 dotnet/runtime WasmTestOnBrowser-System.Runtime.InteropServices.JavaScript.Tests.WorkItemExecution #100765
643885 dotnet/runtime WasmTestOnBrowser-System.Runtime.InteropServices.JavaScript.Tests.WorkItemExecution #100898
643867 dotnet/runtime WasmTestOnBrowser-System.Runtime.InteropServices.JavaScript.Tests.WorkItemExecution #100266
643892 dotnet/runtime WasmTestOnBrowser-System.Runtime.InteropServices.JavaScript.Tests.WorkItemExecution #100949
643833 dotnet/runtime WasmTestOnBrowser-System.Runtime.InteropServices.JavaScript.Tests.WorkItemExecution #100947

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
0 7 7

Known Issue Error Message

Fill the error message using step by step known issues guidance.

{
  "ErrorMessage": "",
  "ErrorPattern": "",
  "BuildRetry": false,
  "ExcludeConsoleLog": false
}
@pavelsavara pavelsavara added arch-wasm WebAssembly architecture blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' area-VM-threading-mono Known Build Error Use this to report build issues in the .NET Helix tab os-browser Browser variant of arch-wasm labels Feb 22, 2024
@pavelsavara pavelsavara added this to the 9.0.0 milestone Feb 22, 2024
@ghost
Copy link

ghost commented Feb 22, 2024

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details

Error Blob

{
  "ErrorMessage": "System.PlatformNotSupportedException : Blocking wait is not supported on the JS interop threads",
  "BuildRetry": false,
  "ErrorPattern": "",
  "ExcludeConsoleLog": false
}

Reproduction Steps

Log
Build: https://dev.azure.com/dnceng-public/public/_build/results?buildId=574940

[22:24:46] info: [FAIL] System.Net.Http.Functional.Tests.SocketsHttpHandler_HttpClientHandlerTest.ReadAsStreamAsync_EmptyResponseBody_HandlerProducesWellBehavedResponseStream
[22:24:46] info: System.PlatformNotSupportedException : Blocking wait is not supported on the JS interop threads.
[22:24:46] info:    at System.Threading.Thread.AssureBlockingPossible()
[22:24:46] info:    at System.Threading.SemaphoreSlim.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
[22:24:46] info:    at System.Threading.SemaphoreSlim.Wait()
[22:24:46] info:    at System.IO.Stream.BeginReadInternal(Byte[] buffer, Int32 offset, Int32 count, AsyncCallback callback, Object state, Boolean serializeAsynchronously, Boolean apm)
[22:24:46] info:    at System.IO.Stream.BeginRead(Byte[] buffer, Int32 offset, Int32 count, AsyncCallback callback, Object state)
[22:24:46] info:    at System.Threading.Tasks.TaskFactory`1[[System.Int32, System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].FromAsyncImpl[Byte[],Int32,Int32](Func`6 beginMethod, Func`2 endFunction, Action`1 endAction, Byte[] arg1, Int32 arg2, Int32 arg3, Object state, TaskCreationOptions creationOptions)
[22:24:46] info:    at System.Threading.Tasks.TaskFactory.FromAsync[Byte[],Int32,Int32,Int32](Func`6 beginMethod, Func`2 endMethod, Byte[] arg1, Int32 arg2, Int32 arg3, Object state)
[22:24:46] info:    at System.Net.Http.Functional.Tests.HttpClientHandlerTest.<ReadAsStreamAsync_EmptyResponseBody_HandlerProducesWellBehavedResponseStream>b__29_0(Uri uri)
[22:24:46] info:    at System.Threading.Tasks.TaskTimeoutExtensions.GetRealException(Task task)
[22:24:46] info: --- End of stack trace from previous location ---
[22:24:46] info:    at System.Threading.Tasks.TaskTimeoutExtensions.WhenAllOrAnyFailed(Task[] tasks)
[22:24:46] info:    at System.Net.Test.Common.LoopbackServerFactory.<>c__DisplayClass6_0.<<CreateClientAndServerAsync>b__0>d.MoveNext()
[22:24:46] info: --- End of stack trace from previous location ---
[22:24:46] info:    at System.Net.Test.Common.LoopbackServer.CreateServerAsync(Func`2 funcAsync, Options options)
[22:24:46] info:    at System.Net.Http.Functional.Tests.HttpClientHandlerTest.ReadAsStreamAsync_EmptyResponseBody_HandlerProducesWellBehavedResponseStream()
[22:24:46] info: --- End of stack trace from previous location ---
Author: pavelsavara
Assignees: -
Labels:

arch-wasm, blocking-clean-ci, area-VM-threading-mono, Known Build Error, os-browser

Milestone: 9.0.0

@pavelsavara
Copy link
Member Author

pavelsavara commented Feb 22, 2024

@radekdoulik I opened this to catch all surprising cases where blocking happens.

In one particular case it's

And I wonder why serializeAsynchronously is false ?

And here is another example Log

@pavelsavara pavelsavara changed the title [browser][MT] [browser][MT] PlatformNotSupportedException Blocking wait is not supported on the JS interop threads Feb 22, 2024
@AlitzelMendez
Copy link
Member

Known issues update: This issue has been affected by the issue described in: dotnet/dnceng#2065. Since all the issues opened after 02/20 can cause the build analysis to fail, I will exclude this issue from the build analysis and add a tracking label to restore it as a known issue once this problem is resolved.

@AlitzelMendez AlitzelMendez added Known Build Error Use this to report build issues in the .NET Helix tab and removed Known Build Error Use this to report build issues in the .NET Helix tab labels Feb 22, 2024
@jozkee
Copy link
Member

jozkee commented Apr 15, 2024

It happened again in https://helixre107v0xdcypoyl9e7f.blob.core.windows.net/dotnet-runtime-refs-pull-100898-merge-475198b81218424ca4/WasmTestOnBrowser-System.Runtime.InteropServices.JavaScript.Tests/1/console.70c98dfd.log?helixlogtype=result

[15:30:18] info: [STRT] System.Runtime.InteropServices.JavaScript.Tests.WebWorkerHttpTest.HttpClient_ContentInDifferentThread(executor1: JSWebWorker, executor2: JSWebWorker)
[15:30:18] warn: [0x07e90040-jsww 15:30:18.437] [MONO] Process terminated.
[15:30:18] warn: [0x07e90040-jsww 15:30:18.440] [MONO] CompleteTask: Unexpected synchronous failure (ManagedThreadId 157): System.PlatformNotSupportedException: Blocking wait is not supported on the JS interop threads.
                    at System.Threading.Thread.AssureBlockingPossible()
                    at System.Threading.ManualResetEventSlim.Wait(Int32 , CancellationToken )
                    at System.Runtime.InteropServices.JavaScript.JavaScriptExports.CompleteTask(JSMarshalerArgument* arguments_buffer)

ErrorMessage is different by a whitespace:

- System.PlatformNotSupportedException : Blocking wait is not supported on the JS interop threads
+ System.PlatformNotSupportedException: Blocking wait is not supported on the JS interop threads

@pavelsavara
Copy link
Member Author

I'm hoping that #101078 fixed it, please re-open if not

@github-actions github-actions bot locked and limited conversation to collaborators May 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly architecture area-VM-threading-mono blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' Known Build Error Use this to report build issues in the .NET Helix tab os-browser Browser variant of arch-wasm
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants