From 33fdb7f2929f57f7453299f231b2762954212611 Mon Sep 17 00:00:00 2001 From: Yoshioka Tsuneo Date: Tue, 13 Jan 2015 13:49:40 +0900 Subject: ActiveRecord: On reconnection failure, release only failed connetion. On reconnection failure, all the connection was released. But, it is better to release only failed connection. This patch changes not to release all the connection but release only failed connection. --- .../lib/active_record/connection_adapters/abstract/connection_pool.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb') 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 6b5081b7a9..d99dc9a5db 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb @@ -454,7 +454,8 @@ module ActiveRecord end c rescue - disconnect! + remove c + c.disconnect! raise end end -- cgit v1.2.3