aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb
diff options
context:
space:
mode:
authoryui-knk <spiketeika@gmail.com>2016-05-11 13:36:32 +0900
committeryui-knk <spiketeika@gmail.com>2016-05-11 13:40:57 +0900
commit64634ce61a6098fd0983252c094b81a5ec4aa5a5 (patch)
tree08118b860afab5d803114322a301fe087ae288bd /activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb
parentd6f3ad7ce7066b8815b4bda4a1e843b2c72c2ad3 (diff)
downloadrails-64634ce61a6098fd0983252c094b81a5ec4aa5a5.tar.gz
rails-64634ce61a6098fd0983252c094b81a5ec4aa5a5.tar.bz2
rails-64634ce61a6098fd0983252c094b81a5ec4aa5a5.zip
[ci skip] Update documents of `ConnectionHandler`
Follow up of #24844. The key of `@owner_to_pool` was changed from `klass.name` to `spec.name`. By this change "memory leaks in development mode" will not happen, bacause the equality of string is not changed by reloading of model files.
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb')
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb4
1 files changed, 1 insertions, 3 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 1bea16ebcc..f3abd01290 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb
@@ -826,9 +826,7 @@ module ActiveRecord
# in order to lookup the correct connection pool.
class ConnectionHandler
def initialize
- # These caches are keyed by klass.name, NOT klass. Keying them by klass
- # alone would lead to memory leaks in development mode as all previous
- # instances of the class would stay in memory.
+ # These caches are keyed by spec.name (ConnectionSpecification#name).
@owner_to_pool = Concurrent::Map.new(:initial_capacity => 2) do |h,k|
h[k] = Concurrent::Map.new(:initial_capacity => 2)
end