Skip to content
Snippets Groups Projects
Unverified Commit fa14976a authored by dependabot[bot]'s avatar dependabot[bot] Committed by GitHub
Browse files

Bump connection_pool from 2.3.0 to 2.4.0 (#24290)

parent 819daeb6
No related branches found
No related tags found
No related merge requests found
......@@ -37,7 +37,17 @@ class ConnectionPool::SharedConnectionPool < ConnectionPool
end
def checkin(preferred_tag)
if ::Thread.current[key(preferred_tag)]
if preferred_tag.is_a?(Hash) && preferred_tag[:force]
# ConnectionPool 2.4+ calls `checkin(force: true)` after fork.
# When this happens, we should remove all connections from Thread.current
::Thread.current.keys.each do |name| # rubocop:disable Style/HashEachMethods
next unless name.to_s.start_with?("#{@key}-")
@available.push(::Thread.current[name])
::Thread.current[name] = nil
end
elsif ::Thread.current[key(preferred_tag)]
if ::Thread.current[key_count(preferred_tag)] == 1
@available.push(::Thread.current[key(preferred_tag)])
::Thread.current[key(preferred_tag)] = nil
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment