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

Potential thread leak in rt_common tests #7010

Closed
tiif opened this issue Dec 3, 2024 · 2 comments
Closed

Potential thread leak in rt_common tests #7010

tiif opened this issue Dec 3, 2024 · 2 comments
Labels
A-tokio Area: The main tokio crate C-bug Category: This is a bug.

Comments

@tiif
Copy link
Contributor

tiif commented Dec 3, 2024

Version
tokio master branch dcae2b9e

Description
When running with cargo miri test --features full --test rt_common, Miri reported error: the main thread terminated without waiting for all remaining threads on the rt_common tests below:

tokio::rt_common current_thread_scheduler::shutdown_timeout_0
tokio::rt_common current_thread_scheduler::shutdown_timeout
tokio::rt_common threaded_scheduler_1_thread::shutdown_timeout
tokio::rt_common threaded_scheduler_1_thread::shutdown_timeout_0
tokio::rt_common threaded_scheduler_4_threads::shutdown_timeout_0
tokio::rt_common threaded_scheduler_4_threads::shutdown_timeout

To reproduce, #![cfg(not(miri))] needs to be removed.

(I am not sure if this is an intended effect, but I will just file it under C-bug just in case this is something that should be fixed.)

@tiif tiif added A-tokio Area: The main tokio crate C-bug Category: This is a bug. labels Dec 3, 2024
@Darksonn
Copy link
Contributor

Darksonn commented Dec 3, 2024

Plausibly we could make the background threads exit more quickly, but it's not possible to actually join them. The shutdown_timeout API explicitly does not join the threads when the timeout hits, after all.

@tiif
Copy link
Contributor Author

tiif commented Dec 4, 2024

This probably falls under rust-lang/miri#1371. Since it is working as expected, I will just close this issue, thanks for answering!

@tiif tiif closed this as completed Dec 4, 2024
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.
Projects
None yet
Development

No branches or pull requests

2 participants