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

Running import asyncio with wasmer/[email protected] in the browser deadlocks #397

Merged
merged 4 commits into from
Jan 5, 2024

Conversation

Michael-F-Bryan
Copy link
Contributor

@Michael-F-Bryan Michael-F-Bryan commented Jan 4, 2024

The reason running import asyncio from Python causes the browser to lock up is because the __asyncifiy_with_deep_sleep() method blocking syscalls until a future resolves, but the setTimeout() future from ThreadPool::sleep_now() never gets a chance to mark itself as resolved because the JavaScript VM is currently blocked by the syscall.

This is very similar to the issue we had where proc_exec() would block while waiting for a HTTP request to finish (see wasmerio/wasmer@293856f from wasmerio/wasmer#4192 for more).

Fixes SDK-73.

Copy link

linear bot commented Jan 4, 2024

Copy link

github-actions bot commented Jan 4, 2024

⏱ Workflow Timer ⏱

Make sure you keep an eye on build times!

The goal is to keep CI times under 10 minutes so developers can maintain a fast edit-compile-test cycle.

Run Compile and Test Build Examples
main 7mins 29s 4mins 29s
3517716 7mins 2s 3mins 54s

🤖 Beep. Boop. I'm a bot. If you find any issues, please report them to https://github.com/Michael-F-Bryan/workflow-timer.

@Michael-F-Bryan Michael-F-Bryan changed the title Running import asyncio with wasmer/[email protected] in the browser blocks up Running import asyncio with wasmer/[email protected] in the browser deadlocks Jan 4, 2024
Michael-F-Bryan added 2 commits January 5, 2024 15:48
@Michael-F-Bryan Michael-F-Bryan marked this pull request as ready for review January 5, 2024 07:51
@Michael-F-Bryan Michael-F-Bryan merged commit dbc77c2 into main Jan 5, 2024
5 checks passed
@Michael-F-Bryan Michael-F-Bryan deleted the sdk-73-fix-python-threading-in-the-browser branch January 5, 2024 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant