aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2012-10-15 14:12:48 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2012-10-15 14:12:48 -0700
commitd92e66f14c137e112e1e7a714ddcb9dd9f7aec3e (patch)
tree3e61f383ce8640ba8c3a17dd15d9329b6629db4b /activerecord
parentb3485b7c9adf43bbcaeabb1b4afb9a3365fecfe7 (diff)
downloadrails-d92e66f14c137e112e1e7a714ddcb9dd9f7aec3e.tar.gz
rails-d92e66f14c137e112e1e7a714ddcb9dd9f7aec3e.tar.bz2
rails-d92e66f14c137e112e1e7a714ddcb9dd9f7aec3e.zip
Synchronize around deleting from the reserved connections hash.
Fixes #7955
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/CHANGELOG.md3
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb2
2 files changed, 4 insertions, 1 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md
index 402c296aee..75f9d76730 100644
--- a/activerecord/CHANGELOG.md
+++ b/activerecord/CHANGELOG.md
@@ -1,5 +1,8 @@
## Rails 3.2.9 (unreleased)
+* Synchronize around deleting from the reserved connections hash.
+ Fixes #7955
+
* PostgreSQL adapter correctly fetches default values when using
multiple schemas and domains in a db. Fixes #7914
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