rails/rails — pull request #6467 by aselder (2012-05-23 18:12:16+00:00)
Title: Synchronize the body of the ConnectionPool#release method to improve thread safety.

Fixes #6464

Synchronize the contents of the release method in ConnectionPool due to
errors when running in high concurrency environments.

Detected invalid hash contents due to unsynchronized modifications with concurrent users
org/jruby/RubyHash.java:1356:in `keys'
/usr/local/rvm/gems/jruby-1.6.7@new_import/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:294:in `release'
/usr/local/rvm/gems/jruby-1.6.7@new_import/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:282:in `checkin'