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

AR connection pool exhaustion #43

Closed
knowtheory opened this issue Apr 14, 2014 · 1 comment
Closed

AR connection pool exhaustion #43

knowtheory opened this issue Apr 14, 2014 · 1 comment

Comments

@knowtheory
Copy link
Member

Because the CloudCrowd server forks off processes using Thread.new in order to prevent the server from blocking, new threads claim an AR connection, but never notify the connection pool when the thread is finished with a connection.

Consequently, if more jobs are quickly submitted than there are connections in the pool, the server freaks out at the empty connection pool. A similar problem is documented in a variety of places:

The solution we're going with is providing an abstraction that takes a block, wraps it inside an explicit AR connection inside of a thread as mperham points out here: sidekiq/sidekiq#1047 (comment)

It'll probably be called CloudCrowd.defer.

@nathanstitt
Copy link
Member

This was fixed in 38aaaef, and has been running without issues for several months now, closing the issue.

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