Skip to content

ActiveRecord ConnectionPool locking issue with 9.2.12.0 #6326

@dgolombek

Description

@dgolombek

Environment Information

Provide at least:

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:

  1. https://github.com/rails/rails/blob/4-2-stable/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb#L262
  2. https://github.com/rails/rails/blob/4-2-stable/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb#L280
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions