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

Blocking calls outside the runtime in debug mode hit wrong assert #2393

Closed
LucioFranco opened this issue Apr 9, 2020 · 4 comments · Fixed by #2410
Closed

Blocking calls outside the runtime in debug mode hit wrong assert #2393

LucioFranco opened this issue Apr 9, 2020 · 4 comments · Fixed by #2410
Assignees
Labels
A-tokio Area: The main tokio crate C-bug Category: This is a bug. M-blocking Module: tokio/task/blocking

Comments

@LucioFranco
Copy link
Member

If you are running a blocking call outside a runtime context while in debug mode you hit https://github.com/tokio-rs/tokio/blob/master/tokio/src/runtime/enter.rs#L60

@LucioFranco LucioFranco added the C-bug Category: This is a bug. label Apr 9, 2020
@LucioFranco LucioFranco self-assigned this Apr 9, 2020
@Darksonn
Copy link
Contributor

What is the relation between this and #2327?

@Darksonn Darksonn added A-tokio Area: The main tokio crate M-blocking Module: tokio/task/blocking labels Apr 20, 2020
@LucioFranco
Copy link
Member Author

@Darksonn this one is a valid error but its hitting the debug_assertion before it can actually hit the legit assertion that gives us the proper info.

@LucioFranco
Copy link
Member Author

cc @carllerche

@jonhoo
Copy link
Sponsor Contributor

jonhoo commented Apr 20, 2020

This will be fixed by #2410.

jonhoo added a commit that referenced this issue Apr 20, 2020
This enables `block_in_place` to be used in more contexts. Specifically,
it allows you to block whenever you are off the tokio runtime (like if
you are not using tokio, are in a `spawn_blocking` closure, etc.), and
in the threaded scheduler's `block_on`. Blocking in `LocalSet` and the
basic scheduler's` block_on` is still disallowed.

Fixes #2327.
Fixes #2393.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio Area: The main tokio crate C-bug Category: This is a bug. M-blocking Module: tokio/task/blocking
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants