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

lpxc leaks threads #10

Closed
msakrejda opened this issue Aug 27, 2014 · 3 comments
Closed

lpxc leaks threads #10

msakrejda opened this issue Aug 27, 2014 · 3 comments

Comments

@msakrejda
Copy link

https://github.com/ryandotsmith/lpxc/blob/master/lib/lpxc.rb#L95-L96

These are only cleaned up when the program exits. Perhaps add a #close to Lpxc?

@technomancy
Copy link
Contributor

It looks like Thread#kill will clean up the actual connections due to the ensure block, so I think this should cover it?

@msakrejda
Copy link
Author

Thanks! Is Thread#kill safe to do in Ruby? I know in Java Thread.stop was eventually removed due to things like failing to handle mutex cleanup.

@technomancy
Copy link
Contributor

My understanding is that there can be issues if the thread being killed shares resources with other threads; however Lpxc is pretty careful about keeping the threads isolated, so if anything fails to get cleaned up in the killed threads they should just get discarded when they're GC'd.

That said, it occurs to be that it would be better to flush before killing off the threads, so I will add that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants