-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
runtime: Remove last slab dependency #2917
Conversation
CI blocked on tokio-rs/loom#175 |
loom 0.3.6 is out. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍 thanks.
24d92e3
to
0a14d9b
Compare
Loom claims to be unhappy about a deadlock in shutdown code. |
Hmm?
We're deadlocked on JoinHandle.wait() but the blocked thread is the only one alive. There shouldn't be any JoinHandles for the initial thread, so it can't wait on itself. Is this a bug in loom? @carllerche |
I'm unable to reproduce this failure locally. Since a rebase is needed anyway, rebasing and seeing if it fails again. |
As far as I can tell, this seems like it might be a loom bug - filed tokio-rs/loom#177 |
Found the loom bug - we're waiting on joinhandles in indeterminate order. Fixing. |
This removes the last slab dependency by replacing the current slab-based JoinHandle tracking with one based on HashMap instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks 👍
This removes the last slab dependency by replacing the current slab-based
JoinHandle tracking with one based on HashMap instead.
Motivation
Cleaning up dependencies
Solution
Slab was only used to track JoinHandles to ensure that all threads are fully cleaned up before returning from
shutdown
(this, in turn, is intended to avoid valgrind false-positives). Since this path isn't particularly performance-critical, this change replaces this use case with a HashMap instead.