diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2012-10-15 14:12:48 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2012-10-15 14:12:48 -0700 |
commit | d92e66f14c137e112e1e7a714ddcb9dd9f7aec3e (patch) | |
tree | 3e61f383ce8640ba8c3a17dd15d9329b6629db4b /activerecord/lib | |
parent | b3485b7c9adf43bbcaeabb1b4afb9a3365fecfe7 (diff) | |
download | rails-d92e66f14c137e112e1e7a714ddcb9dd9f7aec3e.tar.gz rails-d92e66f14c137e112e1e7a714ddcb9dd9f7aec3e.tar.bz2 rails-d92e66f14c137e112e1e7a714ddcb9dd9f7aec3e.zip |
Synchronize around deleting from the reserved connections hash.
Fixes #7955
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb b/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb index ef176a1959..6cb97bc550 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb @@ -116,7 +116,7 @@ module ActiveRecord # #release_connection releases the connection-thread association # and returns the connection to the pool. def release_connection(with_id = current_connection_id) - conn = @reserved_connections.delete(with_id) + conn = synchronize { @reserved_connections.delete(with_id) } checkin conn if conn end |