class ActiveRecord::ConnectionAdapters::ConnectionPool
def reap
a programmer forgets to checkin a connection at the end of a thread
Recover lost connections for the pool. A lost connection can occur if
def reap stale_connections = synchronize do return if self.discarded? @connections.select do |conn| conn.in_use? && !conn.owner.alive? end.each do |conn| conn.steal! end end stale_connections.each do |conn| if conn.active? conn.reset! checkin conn else remove conn end end end