-
-
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
Fix memory leak/growth when creating many runtimes #3564
Conversation
The direction looks good. I think you can use Thanks 👍 |
This comment has been minimized.
This comment has been minimized.
@Darksonn @carllerche this is now ready for (final) review! |
There's a merge conflict. |
* Rather than using a vector of mpsc channels to dispatch received signals, switch to using broadcast channels instead, which automatically clean up after themselves on drop without needing a linear scan
This reverts commit 7dc22cc.
Rebased |
Test failure is for |
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! Super close. Code looks good, I had one nit inline.
Could you add a valgrind test? Ex. https://github.com/tokio-rs/tokio/blob/master/.github/workflows/ci.yml#L71-L91
Added a test, CI is passing now, let me know if anything else is missing! |
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 👍. I'll let @Darksonn do the final review / merge.
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.
Seems fine to me.
switch to using broadcast channels instead, which automatically clean
up after themselves on drop without needing a linear scan
poll_recv
methods onSignal
and after a cursory glance I could not figure out how to refactorbroadcast::Receiver
to have an internal version ofpoll_recv
as we had inmpsc::Receiver
, so appreciate any help here!Refs #3550