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

Backport pull requests #18417 and #18478 (ActiveRecord: On reconnection failure, release only failed connetion) #19408

Conversation

naag
Copy link

@naag naag commented Mar 19, 2015

This is a backport of the pull requests #18417 and #18478 (ActiveRecord: On reconnection failure, release only failed connetion). It would be great to see this come back to 4.2 :-)

rafaelfranca added a commit that referenced this pull request Mar 19, 2015
…cord-connections

Backport pull requests #18417 and #18478 (ActiveRecord: On reconnection failure, release only failed connetion)
@rafaelfranca rafaelfranca merged commit fc67945 into rails:4-2-stable Mar 19, 2015
@guigs
Copy link
Contributor

guigs commented Mar 20, 2015

Thanks! I was debugging this error in one of my apps. Here is a monkey patch that works with Rails 4.0 and 4.1 (create a file in config/initializers):

ActiveRecord::ConnectionAdapters::ConnectionPool.class_eval do

  private

  def checkout_and_verify(c)
    c.run_callbacks :checkout do
      c.verify!
    end
    c
  rescue
    remove c
    c.disconnect!
    raise
  end

end

@naag naag deleted the release-failed-activerecord-connections branch March 22, 2015 21:56
@naag naag restored the release-failed-activerecord-connections branch March 22, 2015 21:56
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.

None yet

3 participants