-
-
Notifications
You must be signed in to change notification settings - Fork 942
Description
Environment Information
Provide at least:
- JRuby version: jruby 9.2.12.0 (2.5.7)
- OS: Linux foo-i0b23b0e45022bfe9a 4.4.0-1110-aws cext will only compile if warnings are lenient. #121-Ubuntu SMP Fri Jun 12 04:21:59 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
- ActiveRecord *: 4.2.11.3
Expected Behavior
ActiveRecord ConnectionPool locks should be acquired and released quickly, as happened with JRuby 9.1.17.0
Actual Behavior
Threads seem to block trying to acquire the ActiveRecord::ConnectionAdapters::ConnectionPool and being very slow to do so, OR something hidden is holding that lock. Our app explodes from ~115 threads to ~350 threads, with most of them either trying to acquire or release the lock on that class. The three locations we see most threads in:
- https://github.com/rails/rails/blob/4-2-stable/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb#L262
- https://github.com/rails/rails/blob/4-2-stable/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb#L280
- https://github.com/rails/rails/blob/4-2-stable/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb#L91
The full 15M Thread dump is at https://gist.githubusercontent.com/dgolombek/8b3ce3c68e7cd53438b758f1825061f5/raw/8aaa8524fd032772b97a5674f3667a1003921a0e/gistfile1.txt
We discussed this on #jruby:matrix.org starting at 2:31 EST on 2020-07-15.