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

Return database connection into pool after configuration #263

Merged
merged 1 commit into from
Apr 14, 2017

Conversation

Envek
Copy link
Contributor

@Envek Envek commented Apr 12, 2017

When application code being loaded has_closure_tree method will get database connection implicitly and will not return it into the pool.

In some circumstances this connection will not be available for request processing at runtime anymore.

In my case I've launched Rails app in Puma application server with one thread and with DB pool size set to one and I was unable to do any requests as only available connection was taken by closure_tree gem (I always get ActiveRecord::ConnectionTimeoutError)

When application code being loaded `has_closure_tree` method will get
database connection implicitly and will not return it into the pool.

In some circumstances this connection will not be available
for request processing at runtime anymore.
@mceachen
Copy link
Collaborator

mceachen commented Apr 12, 2017 via email

@mceachen mceachen merged commit 0f405ca into ClosureTree:master Apr 14, 2017
@Envek Envek deleted the pool-checkin branch April 14, 2017 18:23
@mobilutz
Copy link

@Envek any information when you would release a new version with this.

We just switched from awesome_nested_set to closure_tree some months ago, and saw a rise in ConnectionTimeoutError after that. We guess, it is because of closure_tree not giving back the connections.

@Envek
Copy link
Contributor Author

Envek commented Jun 26, 2017

@mobilutz, please ask @mceachen for release :-)

Until that use gem directly from git:

gem 'closure_tree', github: 'mceachen/closure_tree'

@mobilutz
Copy link

@Envek ah sorry, meant to mention @mceachen 😄
Thanks for your reply though!

We are testing it with that right now on our testing server, but would be good to have a real release for production code 😉

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

Successfully merging this pull request may close these issues.

3 participants