diff options
author | Matthew Draper <matthew@trebex.net> | 2018-08-24 01:42:22 +0930 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-24 01:42:22 +0930 |
commit | 1f05cc58d5c098a626bdb4a43025815d3cef5bac (patch) | |
tree | 10bebb0f00ed3e5bae2962703d4f152e209d651c /activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb | |
parent | a0b57bbb21ce81071220bd8c6cfd8cdda342c6c6 (diff) | |
parent | 0a1ed447999d0092e8d0e86729666fc3b4577151 (diff) | |
download | rails-1f05cc58d5c098a626bdb4a43025815d3cef5bac.tar.gz rails-1f05cc58d5c098a626bdb4a43025815d3cef5bac.tar.bz2 rails-1f05cc58d5c098a626bdb4a43025815d3cef5bac.zip |
Merge pull request #31696 from BrentWheeldon/bmw-connection-pool-load-deadlock
Prevent deadlocks when waiting for connection from pool.
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.rb | 4 |
1 files changed, 3 insertions, 1 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 f721e91203..e977d36cb9 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb @@ -188,7 +188,9 @@ module ActiveRecord t0 = Time.now elapsed = 0 loop do - @cond.wait(timeout - elapsed) + ActiveSupport::Dependencies.interlock.permit_concurrent_loads do + @cond.wait(timeout - elapsed) + end return remove if any? |