Thread leak #177

Closed
FinchPowers opened this Issue Nov 26, 2012 · 2 comments

Projects

None yet

2 participants

@FinchPowers
Contributor

I've got a load balancer crash due to an "error: out of threads"

I think the Cluster.add_nodes leaks threads.

821: default_plugin = clustersetup.DefaultClusterSetup(...

a new DefaultClusterSetup is created. Then add_node

828: default_plugin.on_add_node(...

Then in clustersetup.on_add_node

394: self._setup_hostnames(nodes=[node])

Creates the thread pool. (In fact a bunch of functions here would create it, it's simply a matter of the first needing it creates it.)

And then back to our Cluster.add_nodes context, the pool is not cleared. If I'm not mistaken, It means that every time we add a node, we leak threads.

@FinchPowers
Contributor

I've made a fix attempt https://github.com/datacratic/StarCluster/tree/177_thread_leak
I'll see how it goes.

@jtriley
Owner
jtriley commented Dec 17, 2012

Thanks for reporting, working on a fix for this now.

@jtriley jtriley added a commit that referenced this issue Dec 20, 2012
@jtriley cluster: initial fix for thread leak
Addresses #177 by creating a single copy of the default plugins
rather than creating a new instance each time the defaults are needed.
This avoids piling up threadpools over time in applications such as the
loadbalancer which call addnode and removenode many times over a long
period.
41170d8
@jtriley jtriley added a commit that closed this issue Dec 20, 2012
@jtriley Merge branch 'fix-177' into develop
closes gh-177
609ed70
@jtriley jtriley closed this in 609ed70 Dec 20, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment