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

Spawn blocking blocking sim runtime #139

Closed
LucioFranco opened this issue Sep 12, 2023 · 1 comment
Closed

Spawn blocking blocking sim runtime #139

LucioFranco opened this issue Sep 12, 2023 · 1 comment

Comments

@LucioFranco
Copy link
Member

main...lucio/spawn-blocking-bug#diff-ace3e8abab9fb7b84efd253a7cea095084172b5cc3431426e3391305a554b152R46

With this example code its possible to never run the client future as the server one will hang until all spawn blockings complete. The real answer here is to not use threads since this removes determinism. But this is still surprising behavior. The work around is to use another thread provider like a different tokio runtime (where you call spawn_blocking on that) or std::thread.

cc @MarinPostma @mcches

@mcches
Copy link
Contributor

mcches commented Jan 4, 2024

This is a known issue with a paused runtime where spawn_blocking does not allow time to advance. Since we advance time using a sleep on the LocalSet, things lock up in this scenario.

See: tokio-rs/tokio#5115

We aren't planning to do anything to make this work, rather we'll add tracing events if it occurs in #160.

@mcches mcches closed this as completed Jan 4, 2024
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

No branches or pull requests

2 participants