Open Eyal-Shalev opened 2 years ago
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.
Note that this bug was never fixed.
Wanted to see if I can help find the bug, but I can't even find the place where Atomics.waitAsync
is implemented.
Wanted to see if I can help find the bug, but I can't even find the place where
Atomics.waitAsync
is implemented.
Deno doesn't implement Atomics.waitAsync
, that's implemented in V8, the JS engine that Deno (as well as Node.js and Chrome) use. Assuming this is not a V8 bug, it's almost certainly related to Deno's event loop code not knowing about Atomics.waitAsync
and only knowing about "ops" (Deno's word for Rust functions that are passed into deno_core so they get exposed into the Javascript VM). The relevant code is in JsRuntime::poll_event_loop
(or perhaps elsewhere in JsRuntime
), but I doubt it would be easy to fix.
It's implemented by V8 itself. There's probably some API in V8 to either hook into these APIs or query the number or active timers like this.
I see that there is a test for Atomics.waitAsync
in runtime.rs
but it doesn't involve a worker.
I tried to create a failing test that uses a Blob Worker, but it complains that Blob
is not known - #16747
Do you know how to add the Blob symbol to the runtime for the test?
thread 'runtime::tests::test_pump_message_loop_2' panicked at 'called `Result::unwrap()` on an `Err` value: ReferenceError: Blob is not defined
at pump_message_loop.js:2:1', core/runtime.rs:3356:10
My duplicate issue: https://github.com/denoland/deno/issues/15358
Any news on this. I facing also issues with Atomics.waitAsync does not resolve after calling to Atomics.notify.
According to the
Atomics.waitAsync
documentation, it:However, in my testing it seems like the
waitAsync
doesn't wake (even after callingAtomics.notify
).Moreover, I think that the event loop might be stuck (
setTimeout
didn't work and the test gets stuck) but I don't have any way to verify that.Below are the POC files I used to verify that there is a problem.
poc_test.ts
testdata/poc_worker.ts
output
My Setup WSL2 - Ubuntu