diff options
author | Matthew Draper <matthew@trebex.net> | 2016-11-27 16:45:01 +1030 |
---|---|---|
committer | Matthew Draper <matthew@trebex.net> | 2016-11-27 16:53:04 +1030 |
commit | 969339bd0ec2161af3c0830a9008d32a07c59b8b (patch) | |
tree | 0ab0ab32be6264efaa38b2962322660634f654ef | |
parent | 5921043f9e51dfe0750c13f1ca58d3c912e729c7 (diff) | |
download | rails-969339bd0ec2161af3c0830a9008d32a07c59b8b.tar.gz rails-969339bd0ec2161af3c0830a9008d32a07c59b8b.tar.bz2 rails-969339bd0ec2161af3c0830a9008d32a07c59b8b.zip |
Clear available connections immediately
It'll be re-cleared when it's rebuilt in with_new_connections_blocked's
ensure, but we still need to clear it inside this synchronize -- we've
disconnected connections that may be available in the queue, and while
other threads are not allowed to make *new* connections, they are still
allowed to take existing ones from there.
This was incorrectly removed in d314646c965b045724e6bdb9d61dcecfabc0ba8f.
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb | 2 |
1 files changed, 2 insertions, 0 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 d17722adec..5ec2fc073e 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb @@ -422,6 +422,7 @@ module ActiveRecord conn.disconnect! end @connections = [] + @available.clear end end end @@ -454,6 +455,7 @@ module ActiveRecord conn.disconnect! if conn.requires_reloading? end @connections.delete_if(&:requires_reloading?) + @available.clear end end end |