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

Prevent ignoring spawn_blocking future #2762

Closed
CertainLach opened this issue Aug 11, 2020 · 4 comments
Closed

Prevent ignoring spawn_blocking future #2762

CertainLach opened this issue Aug 11, 2020 · 4 comments
Labels
A-tokio Area: The main tokio crate C-feature-request Category: A feature request.

Comments

@CertainLach
Copy link

Is your feature request related to a problem? Please describe.
Stuck for 1 hour while debugging "deadlocking code", then found panic, which i had ignored in spawn_blocking call, which is not marked as must_use

Describe the solution you'd like
Make spawn_blocking #[must_use]

Describe alternatives you've considered

Additional context

@CertainLach CertainLach added A-tokio Area: The main tokio crate C-feature-request Category: A feature request. labels Aug 11, 2020
CertainLach added a commit to CertainLach/tokio that referenced this issue Aug 11, 2020
To prevent forgetting to handle Panic in JoinError
@Darksonn
Copy link
Contributor

This seems like a near-duplicate of #1830.

@CertainLach
Copy link
Author

Somehow missed this issue while searching for duplicates.

However, my proposal has a different motivation, instead of implementing different JoinHandle Drop behavior, i propose to make just harder to miss a panic in spawned blocking code

@Darksonn
Copy link
Contributor

The JoinHandle type is also used by tokio::spawn, whose return value is commonly ignored.

@carllerche
Copy link
Member

This is not a change for spawn blocking.

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-feature-request Category: A feature request.
Projects
None yet
Development

No branches or pull requests

3 participants