-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Description
Please include the following in your bug report:
Version of emscripten/emsdk:
all
We observer after async fetch is invoked and response callback got executed without any error in worker thread with returner pattern by using ProxyingQueue for the first time, no more tasks could be executed by the queue afterwards.
Steps:
-
setup returner thread:
_looper = std::thread([this](){ emscripten_runtime_keepalive_push(); }); -
enqueue a fetch task to ProxyingQueue
auto requestFn1 = [resp]() mutable { ... emscripten_fetch(...) }; _proxyingQueue.proxyAsync(_session->_looper.native_handle(), requestFn1) -
enqueue another task to ProxyingQueue after attr.onsuccess is invoked on the returner
auto requestFn2 = [resp]() mutable { ... anysimplework(...) }; _proxyingQueue.proxyAsync(_session->_looper.native_handle(), requestFn2)
Observed the requestFn2 is not executed.
Debugged so far:
1 enable -s RUNTIME_DEBUG=1, but there's no log added to the console in headless mode
2 proxyAsync returns 1 in steps 3, however if proxySync is called, the calling thread hangs
3 the returner is still alive during step 3, proved by calling emscripten_async_call recursively with debug information.